[INFO] cloning repository https://github.com/Keith994/rust-practice [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/Keith994/rust-practice" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKeith994%2Frust-practice", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKeith994%2Frust-practice'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 8946e59b28a1cc374083cf15480001b644d5143c [INFO] checking Keith994/rust-practice against try#e071e73523bfcdcab2878dbf652ac8ebb9b9eee4 for pr-144386 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FKeith994%2Frust-practice" "/workspace/builds/worker-7-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-7-tc2/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/Keith994/rust-practice [INFO] finished tweaking git repo https://github.com/Keith994/rust-practice [INFO] tweaked toml for git repo https://github.com/Keith994/rust-practice written to /workspace/builds/worker-7-tc2/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/Keith994/rust-practice on toolchain e071e73523bfcdcab2878dbf652ac8ebb9b9eee4 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+e071e73523bfcdcab2878dbf652ac8ebb9b9eee4" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/Keith994/rust-practice 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" "+e071e73523bfcdcab2878dbf652ac8ebb9b9eee4" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [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:cf8efcab8866f2cf4285301c7418e2f4f2a9b088c91ba69c40d5b659f81557f7" "/opt/rustwide/cargo-home/bin/cargo" "+e071e73523bfcdcab2878dbf652ac8ebb9b9eee4" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 4d5d9e5ab64909f908665e4ebec67f08e4121b4ea3a0d184a4001f87304f2c6c [INFO] running `Command { std: "docker" "start" "-a" "4d5d9e5ab64909f908665e4ebec67f08e4121b4ea3a0d184a4001f87304f2c6c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "4d5d9e5ab64909f908665e4ebec67f08e4121b4ea3a0d184a4001f87304f2c6c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4d5d9e5ab64909f908665e4ebec67f08e4121b4ea3a0d184a4001f87304f2c6c", kill_on_drop: false }` [INFO] [stdout] 4d5d9e5ab64909f908665e4ebec67f08e4121b4ea3a0d184a4001f87304f2c6c [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:cf8efcab8866f2cf4285301c7418e2f4f2a9b088c91ba69c40d5b659f81557f7" "/opt/rustwide/cargo-home/bin/cargo" "+e071e73523bfcdcab2878dbf652ac8ebb9b9eee4" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 75e8518b7869831883924eea29988bca1c62ed1331ae9e270ce8d7fec988ecc0 [INFO] running `Command { std: "docker" "start" "-a" "75e8518b7869831883924eea29988bca1c62ed1331ae9e270ce8d7fec988ecc0", kill_on_drop: false }` [INFO] [stderr] Compiling anyhow v1.0.95 [INFO] [stderr] Compiling crossbeam-utils v0.8.21 [INFO] [stderr] Checking either v1.13.0 [INFO] [stderr] Compiling proc-macro2 v1.0.92 [INFO] [stderr] Compiling unicode-ident v1.0.14 [INFO] [stderr] Compiling serde v1.0.217 [INFO] [stderr] Compiling serde_json v1.0.135 [INFO] [stderr] Checking ryu v1.0.18 [INFO] [stderr] Checking memchr v2.7.4 [INFO] [stderr] Checking binding-borrow v0.1.0 (/opt/rustwide/workdir/binding-borrow) [INFO] [stderr] Checking standard-lib v0.1.0 (/opt/rustwide/workdir/standard-lib) [INFO] [stderr] Checking cell-example v0.1.0 (/opt/rustwide/workdir/cell-example) [INFO] [stderr] Checking maps v0.1.0 (/opt/rustwide/workdir/maps) [INFO] [stderr] Checking walkdir v2.5.0 [INFO] [stderr] Checking utf-8 v0.1.0 (/opt/rustwide/workdir/utf-8) [INFO] [stdout] warning: field `age` is never read [INFO] [stdout] --> maps/src/main.rs:44:3 [INFO] [stdout] | [INFO] [stdout] 42 | struct User { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 43 | name: String, [INFO] [stdout] 44 | age: u8, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `User` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `greeting_file` [INFO] [stdout] --> utf-8/src/main.rs:23:6 [INFO] [stdout] | [INFO] [stdout] 23 | let greeting_file = File::open("hello.txt").unwrap_or_else(|e| match e.kind() { [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_greeting_file` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `age` is never read [INFO] [stdout] --> maps/src/main.rs:44:3 [INFO] [stdout] | [INFO] [stdout] 42 | struct User { [INFO] [stdout] | ---- field in this struct [INFO] [stdout] 43 | name: String, [INFO] [stdout] 44 | age: u8, [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `User` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `greeting_file` [INFO] [stdout] --> utf-8/src/main.rs:23:6 [INFO] [stdout] | [INFO] [stdout] 23 | let greeting_file = File::open("hello.txt").unwrap_or_else(|e| match e.kind() { [INFO] [stdout] | ^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_greeting_file` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking life-time v0.1.0 (/opt/rustwide/workdir/life-time) [INFO] [stdout] error[E0373]: closure may outlive the current function, but it borrows `greeting`, which is owned by the current function [INFO] [stdout] --> life-time/src/bin/fn_1.rs:12:19 [INFO] [stdout] | [INFO] [stdout] 12 | for_each_planet(|planet| println!("Hello {planet},{greeting}")); // 借用了greeting,但是闭包是静态绑定的,则闭包可能活得比main函数久,闭包借用的greeting可能会失效 [INFO] [stdout] | ^^^^^^^^ -------- `greeting` is borrowed here [INFO] [stdout] | | [INFO] [stdout] | may outlive borrowed value `greeting` [INFO] [stdout] | [INFO] [stdout] note: function requires argument type to outlive `'static` [INFO] [stdout] --> life-time/src/bin/fn_1.rs:12:3 [INFO] [stdout] | [INFO] [stdout] 12 | for_each_planet(|planet| println!("Hello {planet},{greeting}")); // 借用了greeting,但是闭包是静态绑定的,则闭包可能活得比main函数久,闭包借用的greeting可能会失效 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] help: to force the closure to take ownership of `greeting` (and any other referenced variables), use the `move` keyword [INFO] [stdout] | [INFO] [stdout] 12 | for_each_planet(move |planet| println!("Hello {planet},{greeting}")); // 借用了greeting,但是闭包是静态绑定的,则闭包可能活得比main函数久,闭包借用的greeting可能会失效 [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0373`. [INFO] [stdout] [INFO] [stdout] error[E0373]: closure may outlive the current function, but it borrows `greeting`, which is owned by the current function [INFO] [stdout] --> life-time/src/bin/fn_1.rs:12:19 [INFO] [stdout] | [INFO] [stdout] 12 | for_each_planet(|planet| println!("Hello {planet},{greeting}")); // 借用了greeting,但是闭包是静态绑定的,则闭包可能活得比main函数久,闭包借用的greeting可能会失效 [INFO] [stdout] | ^^^^^^^^ -------- `greeting` is borrowed here [INFO] [stdout] | | [INFO] [stdout] | may outlive borrowed value `greeting` [INFO] [stdout] | [INFO] [stdout] note: function requires argument type to outlive `'static` [INFO] [stdout] --> life-time/src/bin/fn_1.rs:12:3 [INFO] [stdout] | [INFO] [stdout] 12 | for_each_planet(|planet| println!("Hello {planet},{greeting}")); // 借用了greeting,但是闭包是静态绑定的,则闭包可能活得比main函数久,闭包借用的greeting可能会失效 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] help: to force the closure to take ownership of `greeting` (and any other referenced variables), use the `move` keyword [INFO] [stdout] | [INFO] [stdout] 12 | for_each_planet(move |planet| println!("Hello {planet},{greeting}")); // 借用了greeting,但是闭包是静态绑定的,则闭包可能活得比main函数久,闭包借用的greeting可能会失效 [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0373`. [INFO] [stdout] [INFO] [stderr] error: could not compile `life-time` (bin "fn_1") due to 1 previous error [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: could not compile `life-time` (bin "fn_1" test) due to 1 previous error [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> life-time/src/bin/t_static.rs:17:6 [INFO] [stdout] | [INFO] [stdout] 17 | let x = vec![1, 2, 3, 4, 5, 6, 7, 8].iter().map(|x| x + 3).sum::(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `a` [INFO] [stdout] --> life-time/src/bin/t_static.rs:27:7 [INFO] [stdout] | [INFO] [stdout] 27 | let a = b"Hello, there!\n"; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_a` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: use of moved value: `f` [INFO] [stdout] --> life-time/src/bin/fn_2.rs:20:2 [INFO] [stdout] | [INFO] [stdout] 15 | fn foobar2(f: F) [INFO] [stdout] | - move occurs because `f` has type `F`, which does not implement the `Copy` trait [INFO] [stdout] ... [INFO] [stdout] 19 | f(10); [INFO] [stdout] | ----- `f` moved due to this call [INFO] [stdout] 20 | f(20); [INFO] [stdout] | ^ value used here after move [INFO] [stdout] | [INFO] [stdout] note: `FnOnce` closures can only be called once [INFO] [stdout] --> life-time/src/bin/fn_2.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | F: FnOnce(i32) -> String, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ `F` is made to be an `FnOnce` closure here [INFO] [stdout] 18 | { [INFO] [stdout] 19 | f(10); [INFO] [stdout] | ----- this value implements `FnOnce`, which causes it to be moved when called [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0594]: cannot assign to `acc`, as it is a captured variable in a `Fn` closure [INFO] [stdout] --> life-time/src/bin/fn_2.rs:27:3 [INFO] [stdout] | [INFO] [stdout] 8 | fn foobar1(f: F) [INFO] [stdout] | - change this to accept `FnMut` instead of `Fn` [INFO] [stdout] ... [INFO] [stdout] 26 | foobar1(|x| { [INFO] [stdout] | ------- --- in this closure [INFO] [stdout] | | [INFO] [stdout] | expects `Fn` instead of `FnMut` [INFO] [stdout] 27 | acc += 1; [INFO] [stdout] | ^^^^^^^^ cannot assign [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Container` is never constructed [INFO] [stdout] --> life-time/src/bin/t_static.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | struct Container(T); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `odd`, `value`, and `value3` are never read [INFO] [stdout] --> life-time/src/bin/t_static.rs:35:2 [INFO] [stdout] | [INFO] [stdout] 34 | struct Number<'a> { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 35 | odd: bool, [INFO] [stdout] | ^^^ [INFO] [stdout] 36 | value: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 37 | value3: &'a i32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Number` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_strictly_positive` is never used [INFO] [stdout] --> life-time/src/bin/t_static.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 40 | impl<'a> Number<'a> { [INFO] [stdout] | ------------------- method in this implementation [INFO] [stdout] 41 | fn is_strictly_positive(self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `print_number` is never used [INFO] [stdout] --> life-time/src/bin/t_static.rs:46:4 [INFO] [stdout] | [INFO] [stdout] 46 | fn print_number(n: Number) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: borrow of moved value: `s` [INFO] [stdout] --> life-time/src/bin/fn_2.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 30 | let s = String::from("alright"); [INFO] [stdout] | - move occurs because `s` has type `String`, which does not implement the `Copy` trait [INFO] [stdout] 31 | foobar2(|_| s); [INFO] [stdout] | --- - variable moved due to use in closure [INFO] [stdout] | | [INFO] [stdout] | value moved into closure here [INFO] [stdout] 32 | println!("{s}"); [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] 31 | foobar2(|_| s.clone()); [INFO] [stdout] | ++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0382, E0594. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0382`. [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> life-time/src/bin/t_static.rs:17:6 [INFO] [stdout] | [INFO] [stdout] 17 | let x = vec![1, 2, 3, 4, 5, 6, 7, 8].iter().map(|x| x + 3).sum::(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `a` [INFO] [stdout] --> life-time/src/bin/t_static.rs:27:7 [INFO] [stdout] | [INFO] [stdout] 27 | let a = b"Hello, there!\n"; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_a` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: use of moved value: `f` [INFO] [stdout] --> life-time/src/bin/fn_2.rs:20:2 [INFO] [stdout] | [INFO] [stdout] 15 | fn foobar2(f: F) [INFO] [stdout] | - move occurs because `f` has type `F`, which does not implement the `Copy` trait [INFO] [stdout] ... [INFO] [stdout] 19 | f(10); [INFO] [stdout] | ----- `f` moved due to this call [INFO] [stdout] 20 | f(20); [INFO] [stdout] | ^ value used here after move [INFO] [stdout] | [INFO] [stdout] note: `FnOnce` closures can only be called once [INFO] [stdout] --> life-time/src/bin/fn_2.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | F: FnOnce(i32) -> String, [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ `F` is made to be an `FnOnce` closure here [INFO] [stdout] 18 | { [INFO] [stdout] 19 | f(10); [INFO] [stdout] | ----- this value implements `FnOnce`, which causes it to be moved when called [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0594]: cannot assign to `acc`, as it is a captured variable in a `Fn` closure [INFO] [stdout] --> life-time/src/bin/fn_2.rs:27:3 [INFO] [stdout] | [INFO] [stdout] 8 | fn foobar1(f: F) [INFO] [stdout] | - change this to accept `FnMut` instead of `Fn` [INFO] [stdout] ... [INFO] [stdout] 26 | foobar1(|x| { [INFO] [stdout] | ------- --- in this closure [INFO] [stdout] | | [INFO] [stdout] | expects `Fn` instead of `FnMut` [INFO] [stdout] 27 | acc += 1; [INFO] [stdout] | ^^^^^^^^ cannot assign [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Container` is never constructed [INFO] [stdout] --> life-time/src/bin/t_static.rs:4:8 [INFO] [stdout] | [INFO] [stdout] 4 | struct Container(T); [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `odd`, `value`, and `value3` are never read [INFO] [stdout] --> life-time/src/bin/t_static.rs:35:2 [INFO] [stdout] | [INFO] [stdout] 34 | struct Number<'a> { [INFO] [stdout] | ------ fields in this struct [INFO] [stdout] 35 | odd: bool, [INFO] [stdout] | ^^^ [INFO] [stdout] 36 | value: i32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 37 | value3: &'a i32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Number` has derived impls for the traits `Debug` and `Clone`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `is_strictly_positive` is never used [INFO] [stdout] --> life-time/src/bin/t_static.rs:41:5 [INFO] [stdout] | [INFO] [stdout] 40 | impl<'a> Number<'a> { [INFO] [stdout] | ------------------- method in this implementation [INFO] [stdout] 41 | fn is_strictly_positive(self) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `print_number` is never used [INFO] [stdout] --> life-time/src/bin/t_static.rs:46:4 [INFO] [stdout] | [INFO] [stdout] 46 | fn print_number(n: Number) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `life-time` (bin "fn_2" test) due to 3 previous errors [INFO] [stdout] error[E0382]: borrow of moved value: `s` [INFO] [stdout] --> life-time/src/bin/fn_2.rs:32:13 [INFO] [stdout] | [INFO] [stdout] 30 | let s = String::from("alright"); [INFO] [stdout] | - move occurs because `s` has type `String`, which does not implement the `Copy` trait [INFO] [stdout] 31 | foobar2(|_| s); [INFO] [stdout] | --- - variable moved due to use in closure [INFO] [stdout] | | [INFO] [stdout] | value moved into closure here [INFO] [stdout] 32 | println!("{s}"); [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] 31 | foobar2(|_| s.clone()); [INFO] [stdout] | ++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0382, E0594. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0382`. [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> life-time/src/bin/err_lifetime2.rs:32:19 [INFO] [stdout] | [INFO] [stdout] 10 | fn get_default<'m, K, V>(map: &'m mut HashMap, key: K) -> &'m mut V [INFO] [stdout] | --------- expected `&'m mut V` because of return type [INFO] [stdout] ... [INFO] [stdout] 32 | Some(value) => value, [INFO] [stdout] | ^^^^^ types differ in mutability [INFO] [stdout] | [INFO] [stdout] = note: expected mutable reference `&'m mut _` [INFO] [stdout] found reference `&_` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> life-time/src/bin/err_lifetime2.rs:32:19 [INFO] [stdout] | [INFO] [stdout] 10 | fn get_default<'m, K, V>(map: &'m mut HashMap, key: K) -> &'m mut V [INFO] [stdout] | --------- expected `&'m mut V` because of return type [INFO] [stdout] ... [INFO] [stdout] 32 | Some(value) => value, [INFO] [stdout] | ^^^^^ types differ in mutability [INFO] [stdout] | [INFO] [stdout] = note: expected mutable reference `&'m mut _` [INFO] [stdout] found reference `&_` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0308`. [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0308`. [INFO] [stdout] [INFO] [stderr] error: could not compile `life-time` (bin "fn_2") due to 3 previous errors [INFO] [stderr] error: could not compile `life-time` (bin "err_lifetime2" test) due to 1 previous error [INFO] [stderr] error: could not compile `life-time` (bin "err_lifetime2") due to 1 previous error [INFO] running `Command { std: "docker" "inspect" "75e8518b7869831883924eea29988bca1c62ed1331ae9e270ce8d7fec988ecc0", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "75e8518b7869831883924eea29988bca1c62ed1331ae9e270ce8d7fec988ecc0", kill_on_drop: false }` [INFO] [stdout] 75e8518b7869831883924eea29988bca1c62ed1331ae9e270ce8d7fec988ecc0