[INFO] cloning repository https://github.com/br1code/rust-ownership [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/br1code/rust-ownership" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbr1code%2Frust-ownership", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbr1code%2Frust-ownership'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] bb687a123c246932157b72d9134b507474d1cc6b [INFO] checking br1code/rust-ownership/bb687a123c246932157b72d9134b507474d1cc6b against master#ff1737bb00913444173658b4e0b274fd79aabf66 for pr-132712-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbr1code%2Frust-ownership" "/workspace/builds/worker-4-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-4-tc1/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/br1code/rust-ownership on toolchain ff1737bb00913444173658b4e0b274fd79aabf66 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+ff1737bb00913444173658b4e0b274fd79aabf66" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/br1code/rust-ownership [INFO] finished tweaking git repo https://github.com/br1code/rust-ownership [INFO] tweaked toml for git repo https://github.com/br1code/rust-ownership written to /workspace/builds/worker-4-tc1/source/Cargo.toml [INFO] crate git repo https://github.com/br1code/rust-ownership 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" "+ff1737bb00913444173658b4e0b274fd79aabf66" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/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:4a844ea9eb2546a2d2c7022eacef16ef2e8229c7fbb2c7d4d55a9ceca922f72d" "/opt/rustwide/cargo-home/bin/cargo" "+ff1737bb00913444173658b4e0b274fd79aabf66" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 0924a834579e02bb40fd4e0405a5d5c1051dd7bdbf589aa13a6e69284a41199c [INFO] running `Command { std: "docker" "start" "-a" "0924a834579e02bb40fd4e0405a5d5c1051dd7bdbf589aa13a6e69284a41199c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "0924a834579e02bb40fd4e0405a5d5c1051dd7bdbf589aa13a6e69284a41199c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "0924a834579e02bb40fd4e0405a5d5c1051dd7bdbf589aa13a6e69284a41199c", kill_on_drop: false }` [INFO] [stdout] 0924a834579e02bb40fd4e0405a5d5c1051dd7bdbf589aa13a6e69284a41199c [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-4-tc1/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=allow" "-e" "RUSTDOCFLAGS=--cap-lints=allow" "-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:4a844ea9eb2546a2d2c7022eacef16ef2e8229c7fbb2c7d4d55a9ceca922f72d" "/opt/rustwide/cargo-home/bin/cargo" "+ff1737bb00913444173658b4e0b274fd79aabf66" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] fd2ca7375757c9d9bdb2f32f5906d4f6b287b4ee75bba7ae396fa98655f0b468 [INFO] running `Command { std: "docker" "start" "-a" "fd2ca7375757c9d9bdb2f32f5906d4f6b287b4ee75bba7ae396fa98655f0b468", kill_on_drop: false }` [INFO] [stderr] Checking rust-ownership v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] error[E0106]: missing lifetime specifier [INFO] [stdout] --> src/references_and_borrowing.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | fn dangle() -> &String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] | ^ expected named lifetime parameter [INFO] [stdout] | [INFO] [stdout] = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from [INFO] [stdout] help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` [INFO] [stdout] | [INFO] [stdout] 141 | fn dangle() -> &'static String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] | +++++++ [INFO] [stdout] help: instead, you are more likely to want to return an owned value [INFO] [stdout] | [INFO] [stdout] 141 - fn dangle() -> &String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] 141 + fn dangle() -> String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0106]: missing lifetime specifier [INFO] [stdout] --> src/references_and_borrowing.rs:141:16 [INFO] [stdout] | [INFO] [stdout] 141 | fn dangle() -> &String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] | ^ expected named lifetime parameter [INFO] [stdout] | [INFO] [stdout] = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from [INFO] [stdout] help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` [INFO] [stdout] | [INFO] [stdout] 141 | fn dangle() -> &'static String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] | +++++++ [INFO] [stdout] help: instead, you are more likely to want to return an owned value [INFO] [stdout] | [INFO] [stdout] 141 - fn dangle() -> &String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] 141 + fn dangle() -> String { // error[E0106]: missing lifetime specifier, help: consider giving it a 'static lifetime: `&'static` [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/slice_type.rs:120:40 [INFO] [stdout] | [INFO] [stdout] 120 | fn first_word_signature(s: &String) -> &str {} [INFO] [stdout] | -------------------- ^^^^ expected `&str`, found `()` [INFO] [stdout] | | [INFO] [stdout] | implicitly returns `()` as its body has no tail or `return` expression [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/slice_type.rs:123:44 [INFO] [stdout] | [INFO] [stdout] 123 | fn first_word_better_signature(s: &str) -> &str {} [INFO] [stdout] | --------------------------- ^^^^ expected `&str`, found `()` [INFO] [stdout] | | [INFO] [stdout] | implicitly returns `()` as its body has no tail or `return` expression [INFO] [stdout] | [INFO] [stdout] help: consider returning the local binding `s` [INFO] [stdout] | [INFO] [stdout] 123 | fn first_word_better_signature(s: &str) -> &str { s } [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/slice_type.rs:120:40 [INFO] [stdout] | [INFO] [stdout] 120 | fn first_word_signature(s: &String) -> &str {} [INFO] [stdout] | -------------------- ^^^^ expected `&str`, found `()` [INFO] [stdout] | | [INFO] [stdout] | implicitly returns `()` as its body has no tail or `return` expression [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/slice_type.rs:123:44 [INFO] [stdout] | [INFO] [stdout] 123 | fn first_word_better_signature(s: &str) -> &str {} [INFO] [stdout] | --------------------------- ^^^^ expected `&str`, found `()` [INFO] [stdout] | | [INFO] [stdout] | implicitly returns `()` as its body has no tail or `return` expression [INFO] [stdout] | [INFO] [stdout] help: consider returning the local binding `s` [INFO] [stdout] | [INFO] [stdout] 123 | fn first_word_better_signature(s: &str) -> &str { s } [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable [INFO] [stdout] --> src/slice_type.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 83 | let word = first_word(&s); // -- immutable borrow occurs here [INFO] [stdout] | -- immutable borrow occurs here [INFO] [stdout] 84 | [INFO] [stdout] 85 | s.clear(); // error! error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable [INFO] [stdout] | ^^^^^^^^^ mutable borrow occurs here [INFO] [stdout] ... [INFO] [stdout] 88 | println!("the first word is: {}", word); // ---- immutable borrow later used here [INFO] [stdout] | ---- immutable borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable [INFO] [stdout] --> src/slice_type.rs:85:5 [INFO] [stdout] | [INFO] [stdout] 83 | let word = first_word(&s); // -- immutable borrow occurs here [INFO] [stdout] | -- immutable borrow occurs here [INFO] [stdout] 84 | [INFO] [stdout] 85 | s.clear(); // error! error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable [INFO] [stdout] | ^^^^^^^^^ mutable borrow occurs here [INFO] [stdout] ... [INFO] [stdout] 88 | println!("the first word is: {}", word); // ---- immutable borrow later used here [INFO] [stdout] | ---- immutable borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0502]: cannot borrow `mutable` as mutable because it is also borrowed as immutable [INFO] [stdout] --> src/slice_type.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 95 | let immutable_reference = &mutable; // -------- immutable borrow occurs here [INFO] [stdout] | -------- immutable borrow occurs here [INFO] [stdout] 96 | [INFO] [stdout] 97 | mutable.clear(); // here we try to modify the mutable, but we can't because we already have an immutable reference of the same variable [INFO] [stdout] | ^^^^^^^^^^^^^^^ mutable borrow occurs here [INFO] [stdout] ... [INFO] [stdout] 101 | println!("{}", immutable_reference); // if this wasn't here, the code will be okay. [INFO] [stdout] | ------------------- immutable borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0502]: cannot borrow `mutable` as mutable because it is also borrowed as immutable [INFO] [stdout] --> src/slice_type.rs:97:5 [INFO] [stdout] | [INFO] [stdout] 95 | let immutable_reference = &mutable; // -------- immutable borrow occurs here [INFO] [stdout] | -------- immutable borrow occurs here [INFO] [stdout] 96 | [INFO] [stdout] 97 | mutable.clear(); // here we try to modify the mutable, but we can't because we already have an immutable reference of the same variable [INFO] [stdout] | ^^^^^^^^^^^^^^^ mutable borrow occurs here [INFO] [stdout] ... [INFO] [stdout] 101 | println!("{}", immutable_reference); // if this wasn't here, the code will be okay. [INFO] [stdout] | ------------------- immutable borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0499]: cannot borrow `s` as mutable more than once at a time [INFO] [stdout] --> src/references_and_borrowing.rs:68:14 [INFO] [stdout] | [INFO] [stdout] 67 | let r1 = &mut s; [INFO] [stdout] | ------ first mutable borrow occurs here [INFO] [stdout] 68 | let r2 = &mut s; // error[E0499]: cannot borrow `s` as mutable more than once at a time [INFO] [stdout] | ^^^^^^ second mutable borrow occurs here [INFO] [stdout] 69 | [INFO] [stdout] 70 | println!("{}, {}", r1, r2); [INFO] [stdout] | -- first borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0499]: cannot borrow `s` as mutable more than once at a time [INFO] [stdout] --> src/references_and_borrowing.rs:68:14 [INFO] [stdout] | [INFO] [stdout] 67 | let r1 = &mut s; [INFO] [stdout] | ------ first mutable borrow occurs here [INFO] [stdout] 68 | let r2 = &mut s; // error[E0499]: cannot borrow `s` as mutable more than once at a time [INFO] [stdout] | ^^^^^^ second mutable borrow occurs here [INFO] [stdout] 69 | [INFO] [stdout] 70 | println!("{}, {}", r1, r2); [INFO] [stdout] | -- first borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable [INFO] [stdout] --> src/references_and_borrowing.rs:103:14 [INFO] [stdout] | [INFO] [stdout] 101 | let r1 = &s; // no problem [INFO] [stdout] | -- immutable borrow occurs here [INFO] [stdout] 102 | let r2 = &s; // no problem [INFO] [stdout] 103 | let r3 = &mut s; // BIG PROBLEM [INFO] [stdout] | ^^^^^^ mutable borrow occurs here [INFO] [stdout] 104 | [INFO] [stdout] 105 | println!("{}, {}, and {}", r1, r2, r3); [INFO] [stdout] | -- immutable borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0502]: cannot borrow `s` as mutable because it is also borrowed as immutable [INFO] [stdout] --> src/references_and_borrowing.rs:103:14 [INFO] [stdout] | [INFO] [stdout] 101 | let r1 = &s; // no problem [INFO] [stdout] | -- immutable borrow occurs here [INFO] [stdout] 102 | let r2 = &s; // no problem [INFO] [stdout] 103 | let r3 = &mut s; // BIG PROBLEM [INFO] [stdout] | ^^^^^^ mutable borrow occurs here [INFO] [stdout] 104 | [INFO] [stdout] 105 | println!("{}, {}, and {}", r1, r2, r3); [INFO] [stdout] | -- immutable borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0515]: cannot return reference to local variable `s` [INFO] [stdout] --> src/references_and_borrowing.rs:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | &s // we return a reference to the String, s [INFO] [stdout] | ^^ returns a reference to data owned by the current function [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0515]: cannot return reference to local variable `s` [INFO] [stdout] --> src/references_and_borrowing.rs:144:5 [INFO] [stdout] | [INFO] [stdout] 144 | &s // we return a reference to the String, s [INFO] [stdout] | ^^ returns a reference to data owned by the current function [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: borrow of moved value: `s1` [INFO] [stdout] --> src/main.rs:154:28 [INFO] [stdout] | [INFO] [stdout] 151 | let s1 = String::from("hello"); [INFO] [stdout] | -- move occurs because `s1` has type `String`, which does not implement the `Copy` trait [INFO] [stdout] 152 | let s2 = s1; [INFO] [stdout] | -- value moved here [INFO] [stdout] 153 | [INFO] [stdout] 154 | println!("{}, world!", s1); [INFO] [stdout] | ^^ value borrowed here after move [INFO] [stdout] | [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] help: consider cloning the value if the performance cost is acceptable [INFO] [stdout] | [INFO] [stdout] 152 | let s2 = s1.clone(); [INFO] [stdout] | ++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: borrow of moved value: `s1` [INFO] [stdout] --> src/main.rs:154:28 [INFO] [stdout] | [INFO] [stdout] 151 | let s1 = String::from("hello"); [INFO] [stdout] | -- move occurs because `s1` has type `String`, which does not implement the `Copy` trait [INFO] [stdout] 152 | let s2 = s1; [INFO] [stdout] | -- value moved here [INFO] [stdout] 153 | [INFO] [stdout] 154 | println!("{}, world!", s1); [INFO] [stdout] | ^^ value borrowed here after move [INFO] [stdout] | [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] help: consider cloning the value if the performance cost is acceptable [INFO] [stdout] | [INFO] [stdout] 152 | let s2 = s1.clone(); [INFO] [stdout] | ++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0106, E0308, E0382, E0499, E0502, E0515. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0106`. [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0106, E0308, E0382, E0499, E0502, E0515. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0106`. [INFO] [stdout] [INFO] [stderr] error: could not compile `rust-ownership` (bin "rust-ownership") due to 9 previous errors [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: could not compile `rust-ownership` (bin "rust-ownership" test) due to 9 previous errors [INFO] running `Command { std: "docker" "inspect" "fd2ca7375757c9d9bdb2f32f5906d4f6b287b4ee75bba7ae396fa98655f0b468", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "fd2ca7375757c9d9bdb2f32f5906d4f6b287b4ee75bba7ae396fa98655f0b468", kill_on_drop: false }` [INFO] [stdout] fd2ca7375757c9d9bdb2f32f5906d4f6b287b4ee75bba7ae396fa98655f0b468