[INFO] cloning repository https://github.com/osobiehl/rust-for-cpp-devs [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/osobiehl/rust-for-cpp-devs" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fosobiehl%2Frust-for-cpp-devs", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fosobiehl%2Frust-for-cpp-devs'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] e9907d34e928e4e76d215da9c2af268639f35b8e [INFO] checking osobiehl/rust-for-cpp-devs against try#a75eafceea413a1b40c0e0769db85e08ec17160b for pr-133925 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fosobiehl%2Frust-for-cpp-devs" "/workspace/builds/worker-7-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/osobiehl/rust-for-cpp-devs on toolchain a75eafceea413a1b40c0e0769db85e08ec17160b [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+a75eafceea413a1b40c0e0769db85e08ec17160b" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/osobiehl/rust-for-cpp-devs [INFO] finished tweaking git repo https://github.com/osobiehl/rust-for-cpp-devs [INFO] tweaked toml for git repo https://github.com/osobiehl/rust-for-cpp-devs written to /workspace/builds/worker-7-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/osobiehl/rust-for-cpp-devs already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+a75eafceea413a1b40c0e0769db85e08ec17160b" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: file `/workspace/builds/worker-7-tc2/source/03_borrow_checking/01_references.rs` found to be present in multiple build targets: [INFO] [stderr] * `bin` target `01_borrow_checking` [INFO] [stderr] * `bin` target `01_references` [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] [stderr] Blocking waiting for file lock on package cache [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:c80049f3b88b82089a44e0f06d0d6029d44b96b7257e55a1cd63dbc9f4c33334" "/opt/rustwide/cargo-home/bin/cargo" "+a75eafceea413a1b40c0e0769db85e08ec17160b" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] c1b4f8562203714df43e068607c2e7cb0fa4c690e90976a864a7188591710299 [INFO] running `Command { std: "docker" "start" "-a" "c1b4f8562203714df43e068607c2e7cb0fa4c690e90976a864a7188591710299", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "c1b4f8562203714df43e068607c2e7cb0fa4c690e90976a864a7188591710299", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c1b4f8562203714df43e068607c2e7cb0fa4c690e90976a864a7188591710299", kill_on_drop: false }` [INFO] [stdout] c1b4f8562203714df43e068607c2e7cb0fa4c690e90976a864a7188591710299 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-7-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:c80049f3b88b82089a44e0f06d0d6029d44b96b7257e55a1cd63dbc9f4c33334" "/opt/rustwide/cargo-home/bin/cargo" "+a75eafceea413a1b40c0e0769db85e08ec17160b" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] a89e30e5c0665d34e6707436cf4881f3889edc8c877969dc107936864978aaa1 [INFO] running `Command { std: "docker" "start" "-a" "a89e30e5c0665d34e6707436cf4881f3889edc8c877969dc107936864978aaa1", kill_on_drop: false }` [INFO] [stderr] warning: file `/opt/rustwide/workdir/03_borrow_checking/01_references.rs` found to be present in multiple build targets: [INFO] [stderr] * `bin` target `01_borrow_checking` [INFO] [stderr] * `bin` target `01_references` [INFO] [stderr] Checking rust_for_cpp_devs v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: function `main` is never used [INFO] [stdout] --> src/lib.rs:1:4 [INFO] [stdout] | [INFO] [stdout] 1 | fn main() { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0106]: missing lifetime specifier [INFO] [stdout] --> 03_borrow_checking/01_references.rs:22:47 [INFO] [stdout] | [INFO] [stdout] 22 | fn oldest_person(p1: &Person, p2: &Person) -> &Person{ [INFO] [stdout] | ------- ------- ^ expected named lifetime parameter [INFO] [stdout] | [INFO] [stdout] = help: this function's return type contains a borrowed value, but the signature does not say whether it is borrowed from `p1` or `p2` [INFO] [stdout] help: consider introducing a named lifetime parameter [INFO] [stdout] | [INFO] [stdout] 22 | fn oldest_person<'a>(p1: &'a Person, p2: &'a Person) -> &'a Person{ [INFO] [stdout] | ++++ ++ ++ ++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0106`. [INFO] [stdout] [INFO] [stderr] error: could not compile `rust_for_cpp_devs` (bin "01_references") due to 1 previous error [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stdout] error[E0425]: cannot find value `new_value` in this scope [INFO] [stdout] --> 02_common_uses/03_user_types.rs:30:26 [INFO] [stdout] | [INFO] [stdout] 30 | my_struct.set_my_int(new_value); [INFO] [stdout] | ^^^^^^^^^ not found in this scope [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: expected `;`, found `println` [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:23:6 [INFO] [stdout] | [INFO] [stdout] 23 | } [INFO] [stdout] | ^ help: add `;` here [INFO] [stdout] 24 | [INFO] [stdout] 25 | println!("{}", x_text); [INFO] [stdout] | ------- unexpected token [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: expected `;`, found `std` [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:32:30 [INFO] [stdout] | [INFO] [stdout] 32 | let s = String::new() [INFO] [stdout] | ^ help: add `;` here [INFO] [stdout] 33 | std::io::stdin().read_line(&mut s).expect("io failed"); [INFO] [stdout] | --- unexpected token [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: expected `;`, found `do_check_if` [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:37:6 [INFO] [stdout] | [INFO] [stdout] 37 | } [INFO] [stdout] | ^ help: add `;` here [INFO] [stdout] 38 | do_check_if(should_be_42); [INFO] [stdout] | ----------- unexpected token [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: borrow of moved value: `v` [INFO] [stdout] --> 02_common_uses/06_iterators.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 2 | fn duplicate_vector(v: &mut Vec){ [INFO] [stdout] | - move occurs because `v` has type `&mut Vec`, which does not implement the `Copy` trait [INFO] [stdout] 3 | for n in v{ [INFO] [stdout] | - `v` moved due to this implicit call to `.into_iter()` [INFO] [stdout] 4 | v.push(*n); [INFO] [stdout] | ^ value borrowed here after move [INFO] [stdout] | [INFO] [stdout] note: `into_iter` takes ownership of the receiver `self`, which moves `v` [INFO] [stdout] --> /rustc/a75eafceea413a1b40c0e0769db85e08ec17160b/library/core/src/iter/traits/collect.rs:313:18 [INFO] [stdout] help: consider creating a fresh reborrow of `v` here [INFO] [stdout] | [INFO] [stdout] 3 | for n in &mut *v{ [INFO] [stdout] | ++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0277]: `MyStruct` doesn't implement `std::fmt::Display` [INFO] [stdout] --> 02_common_uses/03_user_types.rs:31:20 [INFO] [stdout] | [INFO] [stdout] 31 | println!("{}", my_struct); [INFO] [stdout] | ^^^^^^^^^ `MyStruct` cannot be formatted with the default formatter [INFO] [stdout] | [INFO] [stdout] = help: the trait `std::fmt::Display` is not implemented for `MyStruct` [INFO] [stdout] = note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead [INFO] [stdout] = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info) [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:7:8 [INFO] [stdout] | [INFO] [stdout] 7 | if (x == 0) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 7 - if (x == 0) { [INFO] [stdout] 7 + if x == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:9:15 [INFO] [stdout] | [INFO] [stdout] 9 | } else if (x < 100) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 9 - } else if (x < 100) { [INFO] [stdout] 9 + } else if x < 100 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0382`. [INFO] [stdout] [INFO] [stdout] error: expected `;`, found `println` [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:23:6 [INFO] [stdout] | [INFO] [stdout] 23 | } [INFO] [stdout] | ^ help: add `;` here [INFO] [stdout] 24 | [INFO] [stdout] 25 | println!("{}", x_text); [INFO] [stdout] | ------- unexpected token [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: expected `;`, found `std` [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:32:30 [INFO] [stdout] | [INFO] [stdout] 32 | let s = String::new() [INFO] [stdout] | ^ help: add `;` here [INFO] [stdout] 33 | std::io::stdin().read_line(&mut s).expect("io failed"); [INFO] [stdout] | --- unexpected token [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: expected `;`, found `do_check_if` [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:37:6 [INFO] [stdout] | [INFO] [stdout] 37 | } [INFO] [stdout] | ^ help: add `;` here [INFO] [stdout] 38 | do_check_if(should_be_42); [INFO] [stdout] | ----------- unexpected token [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0594]: cannot assign to `self.my_int`, which is behind a `&` reference [INFO] [stdout] --> 02_common_uses/03_user_types.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | self.my_int = new_value; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^ `self` is a `&` reference, so the data it refers to cannot be written [INFO] [stdout] | [INFO] [stdout] help: consider changing this to be a mutable reference [INFO] [stdout] | [INFO] [stdout] 19 | pub fn set_my_int(&mut self, new_value: i32){ [INFO] [stdout] | ~~~~~~~~~ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0277, E0425, E0594. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0277`. [INFO] [stdout] [INFO] [stdout] error[E0782]: expected a type, found a trait [INFO] [stdout] --> 02_common_uses/04_interfaces.rs:25:36 [INFO] [stdout] | [INFO] [stdout] 25 | fn runtime_polymorphism(drawable: &Drawable){ [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] help: use a new generic type parameter, constrained by `Drawable` [INFO] [stdout] | [INFO] [stdout] 25 | fn runtime_polymorphism(drawable: &T){ [INFO] [stdout] | +++++++++++++ ~ [INFO] [stdout] help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference [INFO] [stdout] | [INFO] [stdout] 25 | fn runtime_polymorphism(drawable: &impl Drawable){ [INFO] [stdout] | ++++ [INFO] [stdout] help: alternatively, use a trait object to accept any type that implements `Drawable`, accessing its methods at runtime using dynamic dispatch [INFO] [stdout] | [INFO] [stdout] 25 | fn runtime_polymorphism(drawable: &dyn Drawable){ [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:33:36 [INFO] [stdout] | [INFO] [stdout] 33 | std::io::stdin().read_line(&mut s).expect("io failed"); [INFO] [stdout] | ^^^^^^ cannot borrow as mutable [INFO] [stdout] | [INFO] [stdout] help: consider changing this to be mutable [INFO] [stdout] | [INFO] [stdout] 32 | let mut s = String::new() [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0596`. [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:7:8 [INFO] [stdout] | [INFO] [stdout] 7 | if (x == 0) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 7 - if (x == 0) { [INFO] [stdout] 7 + if x == 0 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `rust_for_cpp_devs` (bin "06_iterators") due to 1 previous error [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:9:15 [INFO] [stdout] | [INFO] [stdout] 9 | } else if (x < 100) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 9 - } else if (x < 100) { [INFO] [stdout] 9 + } else if x < 100 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `rust_for_cpp_devs` (bin "02_control_flow" test) due to 4 previous errors; 2 warnings emitted [INFO] [stdout] error[E0596]: cannot borrow `s` as mutable, as it is not declared as mutable [INFO] [stdout] --> 01_basic_syntax/02_control_flow.rs:33:36 [INFO] [stdout] | [INFO] [stdout] 33 | std::io::stdin().read_line(&mut s).expect("io failed"); [INFO] [stdout] | ^^^^^^ cannot borrow as mutable [INFO] [stdout] | [INFO] [stdout] help: consider changing this to be mutable [INFO] [stdout] | [INFO] [stdout] 32 | let mut s = String::new() [INFO] [stdout] | +++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0596`. [INFO] [stdout] [INFO] [stderr] error: could not compile `rust_for_cpp_devs` (bin "03_user_types" test) due to 3 previous errors [INFO] [stderr] error: could not compile `rust_for_cpp_devs` (bin "02_control_flow") due to 4 previous errors; 2 warnings emitted [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> 02_common_uses/04_interfaces.rs:38:31 [INFO] [stdout] | [INFO] [stdout] 38 | compile_time_polymorphism(c); [INFO] [stdout] | ------------------------- ^ expected `&_`, found `Circle` [INFO] [stdout] | | [INFO] [stdout] | arguments to this function are incorrect [INFO] [stdout] | [INFO] [stdout] = note: expected reference `&_` [INFO] [stdout] found struct `Circle` [INFO] [stdout] note: function defined here [INFO] [stdout] --> 02_common_uses/04_interfaces.rs:29:4 [INFO] [stdout] | [INFO] [stdout] 29 | fn compile_time_polymorphism( drawable: &T){ [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ ------------ [INFO] [stdout] help: consider borrowing here [INFO] [stdout] | [INFO] [stdout] 38 | compile_time_polymorphism(&c); [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0308, E0782. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0308`. [INFO] [stdout] [INFO] [stderr] error: could not compile `rust_for_cpp_devs` (bin "04_interfaces") due to 2 previous errors [INFO] running `Command { std: "docker" "inspect" "a89e30e5c0665d34e6707436cf4881f3889edc8c877969dc107936864978aaa1", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a89e30e5c0665d34e6707436cf4881f3889edc8c877969dc107936864978aaa1", kill_on_drop: false }` [INFO] [stdout] a89e30e5c0665d34e6707436cf4881f3889edc8c877969dc107936864978aaa1