[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#f609b7e0586f81fefb3523e3e17adf779ac416be for pr-129466-2 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbr1code%2Frust-ownership" "/workspace/builds/worker-0-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-0-tc1/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/br1code/rust-ownership on toolchain f609b7e0586f81fefb3523e3e17adf779ac416be [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "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-0-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" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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:6252d7ea7fb8caaf7af6d800c5fb250a9cd862b9a7f9508afb3c54fa7fe1102e" "/opt/rustwide/cargo-home/bin/cargo" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] ac06fb0c11c1e32bf254cd52f38f112da98b19042a7422a73cf6f9f7180cdf54 [INFO] running `Command { std: "docker" "start" "-a" "ac06fb0c11c1e32bf254cd52f38f112da98b19042a7422a73cf6f9f7180cdf54", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ac06fb0c11c1e32bf254cd52f38f112da98b19042a7422a73cf6f9f7180cdf54", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ac06fb0c11c1e32bf254cd52f38f112da98b19042a7422a73cf6f9f7180cdf54", kill_on_drop: false }` [INFO] [stdout] ac06fb0c11c1e32bf254cd52f38f112da98b19042a7422a73cf6f9f7180cdf54 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-0-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=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:6252d7ea7fb8caaf7af6d800c5fb250a9cd862b9a7f9508afb3c54fa7fe1102e" "/opt/rustwide/cargo-home/bin/cargo" "+f609b7e0586f81fefb3523e3e17adf779ac416be" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 4c03d78697308230ec0fd1b88e12bcff5a7cff04c86da3eac660670af0cea0fb [INFO] running `Command { std: "docker" "start" "-a" "4c03d78697308230ec0fd1b88e12bcff5a7cff04c86da3eac660670af0cea0fb", 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: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: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] warning: unused variable: `hello` [INFO] [stdout] --> src/slice_type.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | let hello = &s[0..5]; // hello [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_hello` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `hello` [INFO] [stdout] --> src/slice_type.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | let hello = &s[0..5]; // hello [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_hello` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `world` [INFO] [stdout] --> src/slice_type.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | let world = &s[6..11]; // world [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_world` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `world` [INFO] [stdout] --> src/slice_type.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | let world = &s[6..11]; // world [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_world` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | let slice = &s[0..2]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | let slice = &s[0..2]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | let slice = &s[..2]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:29:9 [INFO] [stdout] | [INFO] [stdout] 29 | let slice = &s[..2]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | let slice = &s[3..len]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | let slice = &s[3..len]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | let slice = &s[3..]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | let slice = &s[3..]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:48:9 [INFO] [stdout] | [INFO] [stdout] 48 | let slice = &s[0..len]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:48:9 [INFO] [stdout] | [INFO] [stdout] 48 | let slice = &s[0..len]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | let slice = &s[..]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | let slice = &s[..]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [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] warning: unused variable: `s` [INFO] [stdout] --> src/slice_type.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | let s = "Hello, world!"; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/slice_type.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | let word = first_word_better_signature(&my_string[..]); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/slice_type.rs:113:9 [INFO] [stdout] | [INFO] [stdout] 113 | let s = "Hello, world!"; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/slice_type.rs:131:9 [INFO] [stdout] | [INFO] [stdout] 131 | let word = first_word_better_signature(&my_string[..]); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/slice_type.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | let word = first_word_better_signature(&my_string_literal[..]); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/slice_type.rs:136:9 [INFO] [stdout] | [INFO] [stdout] 136 | let word = first_word_better_signature(&my_string_literal[..]); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/slice_type.rs:140:9 [INFO] [stdout] | [INFO] [stdout] 140 | let word = first_word_better_signature(my_string_literal); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `a` [INFO] [stdout] --> src/slice_type.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | let a = [1, 2, 3, 4, 5]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_a` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/slice_type.rs:140:9 [INFO] [stdout] | [INFO] [stdout] 140 | let word = first_word_better_signature(my_string_literal); [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:153:9 [INFO] [stdout] | [INFO] [stdout] 153 | let slice = &a[1..3]; // [2, 3] [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `a` [INFO] [stdout] --> src/slice_type.rs:146:9 [INFO] [stdout] | [INFO] [stdout] 146 | let a = [1, 2, 3, 4, 5]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_a` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/slice_type.rs:153:9 [INFO] [stdout] | [INFO] [stdout] 153 | let slice = &a[1..3]; // [2, 3] [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `some_string` [INFO] [stdout] --> src/references_and_borrowing.rs:41:11 [INFO] [stdout] | [INFO] [stdout] 41 | fn change(some_string: &String) { [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_some_string` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `some_string` [INFO] [stdout] --> src/references_and_borrowing.rs:41:11 [INFO] [stdout] | [INFO] [stdout] 41 | fn change(some_string: &String) { [INFO] [stdout] | ^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_some_string` [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] warning: unused variable: `r1` [INFO] [stdout] --> src/references_and_borrowing.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | let r1 = &mut s; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_r1` [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] warning: unused variable: `r2` [INFO] [stdout] --> src/references_and_borrowing.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | let r2 = &mut s; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_r2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `r1` [INFO] [stdout] --> src/references_and_borrowing.rs:91:13 [INFO] [stdout] | [INFO] [stdout] 91 | let r1 = &mut s; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_r1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `r2` [INFO] [stdout] --> src/references_and_borrowing.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | let r2 = &mut s; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_r2` [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] warning: unused variable: `reference_to_nothing` [INFO] [stdout] --> src/references_and_borrowing.rs:137:9 [INFO] [stdout] | [INFO] [stdout] 137 | let reference_to_nothing = dangle(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_reference_to_nothing` [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] warning: unused variable: `reference_to_nothing` [INFO] [stdout] --> src/references_and_borrowing.rs:137:9 [INFO] [stdout] | [INFO] [stdout] 137 | let reference_to_nothing = dangle(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_reference_to_nothing` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/main.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | let s = "hello"; // s is valid from this point forward [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/main.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | let s = String::from("hello"); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [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] warning: unused variable: `s` [INFO] [stdout] --> src/main.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | let s = "hello"; // s is valid from this point forward [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/main.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | let s = String::from("hello"); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/main.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let s = String::from("hello"); // s is valid from this point forward [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/main.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | let y = x; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s2` [INFO] [stdout] --> src/main.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | let s2 = s1; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/main.rs:98:9 [INFO] [stdout] | [INFO] [stdout] 98 | let s = String::from("hello"); // s is valid from this point forward [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s2` [INFO] [stdout] --> src/main.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | let s2 = s1; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/main.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | let y = x; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s2` [INFO] [stdout] --> src/main.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | let s2 = s1; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s2` [INFO] [stdout] --> src/main.rs:152:9 [INFO] [stdout] | [INFO] [stdout] 152 | let s2 = s1; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s2` [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] warning: unused variable: `s1` [INFO] [stdout] --> src/main.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | let s1 = gives_ownership(); // gives_ownership moves its return value into s1 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s3` [INFO] [stdout] --> src/main.rs:250:9 [INFO] [stdout] | [INFO] [stdout] 250 | let s3 = takes_and_gives_back(s2); // s2 is moved into takes_and_gives_back, which also moves its return value into s3 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s1` [INFO] [stdout] --> src/main.rs:246:9 [INFO] [stdout] | [INFO] [stdout] 246 | let s1 = gives_ownership(); // gives_ownership moves its return value into s1 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s3` [INFO] [stdout] --> src/main.rs:250:9 [INFO] [stdout] | [INFO] [stdout] 250 | let s3 = takes_and_gives_back(s2); // s2 is moved into takes_and_gives_back, which also moves its return value into s3 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 9 previous errors; 26 warnings emitted [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] error: aborting due to 9 previous errors; 26 warnings emitted [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] [stderr] error: could not compile `rust-ownership` (bin "rust-ownership") due to 10 previous errors; 26 warnings emitted [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 10 previous errors; 26 warnings emitted [INFO] running `Command { std: "docker" "inspect" "4c03d78697308230ec0fd1b88e12bcff5a7cff04c86da3eac660670af0cea0fb", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4c03d78697308230ec0fd1b88e12bcff5a7cff04c86da3eac660670af0cea0fb", kill_on_drop: false }` [INFO] [stdout] 4c03d78697308230ec0fd1b88e12bcff5a7cff04c86da3eac660670af0cea0fb