[INFO] cloning repository https://github.com/yavrib/rust-closures-playground [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/yavrib/rust-closures-playground" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fyavrib%2Frust-closures-playground", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fyavrib%2Frust-closures-playground'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] ac31b4f22d24ab919d6edb5ab9396af3f9bbecc3 [INFO] checking yavrib/rust-closures-playground against master#af4a5a13a15fa0c60e06321077ef452f769b42fd for pr-122960-4 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fyavrib%2Frust-closures-playground" "/workspace/builds/worker-2-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc1/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/yavrib/rust-closures-playground on toolchain af4a5a13a15fa0c60e06321077ef452f769b42fd [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+af4a5a13a15fa0c60e06321077ef452f769b42fd" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/yavrib/rust-closures-playground [INFO] finished tweaking git repo https://github.com/yavrib/rust-closures-playground [INFO] tweaked toml for git repo https://github.com/yavrib/rust-closures-playground written to /workspace/builds/worker-2-tc1/source/Cargo.toml [INFO] crate git repo https://github.com/yavrib/rust-closures-playground 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" "+af4a5a13a15fa0c60e06321077ef452f769b42fd" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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:2788e3201cd34a07e3172128adcd8b3090168a8e3bcc40d7c032b9dda1df7d1c" "/opt/rustwide/cargo-home/bin/cargo" "+af4a5a13a15fa0c60e06321077ef452f769b42fd" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] a7a138964685362e028a090349bde640d4a99b012d7ad4a2406f356579971e29 [INFO] running `Command { std: "docker" "start" "-a" "a7a138964685362e028a090349bde640d4a99b012d7ad4a2406f356579971e29", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "a7a138964685362e028a090349bde640d4a99b012d7ad4a2406f356579971e29", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a7a138964685362e028a090349bde640d4a99b012d7ad4a2406f356579971e29", kill_on_drop: false }` [INFO] [stdout] a7a138964685362e028a090349bde640d4a99b012d7ad4a2406f356579971e29 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc1/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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:2788e3201cd34a07e3172128adcd8b3090168a8e3bcc40d7c032b9dda1df7d1c" "/opt/rustwide/cargo-home/bin/cargo" "+af4a5a13a15fa0c60e06321077ef452f769b42fd" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 9eec681a305ef7e07762d7bff694696b60902830d3a3f99f627d0d062a2eb46b [INFO] running `Command { std: "docker" "start" "-a" "9eec681a305ef7e07762d7bff694696b60902830d3a3f99f627d0d062a2eb46b", kill_on_drop: false }` [INFO] [stderr] Checking rust-closures-playground v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] error[E0106]: missing lifetime specifier [INFO] [stdout] --> src/main.rs:3:57 [INFO] [stdout] | [INFO] [stdout] 3 | fn no_lifetime_specified_higher_order_function() -> &(Fn(i32) -> i32) { [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] 3 | fn no_lifetime_specified_higher_order_function() -> &'static (Fn(i32) -> i32) { [INFO] [stdout] | +++++++ [INFO] [stdout] help: instead, you are more likely to want to return an owned value [INFO] [stdout] | [INFO] [stdout] 3 - fn no_lifetime_specified_higher_order_function() -> &(Fn(i32) -> i32) { [INFO] [stdout] 3 + fn no_lifetime_specified_higher_order_function() -> (Fn(i32) -> i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0106]: missing lifetime specifier [INFO] [stdout] --> src/main.rs:3:57 [INFO] [stdout] | [INFO] [stdout] 3 | fn no_lifetime_specified_higher_order_function() -> &(Fn(i32) -> i32) { [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] 3 | fn no_lifetime_specified_higher_order_function() -> &'static (Fn(i32) -> i32) { [INFO] [stdout] | +++++++ [INFO] [stdout] help: instead, you are more likely to want to return an owned value [INFO] [stdout] | [INFO] [stdout] 3 - fn no_lifetime_specified_higher_order_function() -> &(Fn(i32) -> i32) { [INFO] [stdout] 3 + fn no_lifetime_specified_higher_order_function() -> (Fn(i32) -> i32) { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/main.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 3 | fn no_lifetime_specified_higher_order_function() -> &(Fn(i32) -> i32) { [INFO] [stdout] | ----------------- expected `&'static (dyn Fn(i32) -> i32 + 'static)` because of return type [INFO] [stdout] ... [INFO] [stdout] 6 | |x| x + num [INFO] [stdout] | ^^^^^^^^^^^ expected `&dyn Fn(i32) -> i32`, found closure [INFO] [stdout] | [INFO] [stdout] = note: expected reference `&'static (dyn Fn(i32) -> i32 + 'static)` [INFO] [stdout] found closure `{closure@src/main.rs:6:9: 6:12}` [INFO] [stdout] help: consider borrowing here [INFO] [stdout] | [INFO] [stdout] 6 | &|x| x + num [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/main.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 3 | fn no_lifetime_specified_higher_order_function() -> &(Fn(i32) -> i32) { [INFO] [stdout] | ----------------- expected `&'static (dyn Fn(i32) -> i32 + 'static)` because of return type [INFO] [stdout] ... [INFO] [stdout] 6 | |x| x + num [INFO] [stdout] | ^^^^^^^^^^^ expected `&dyn Fn(i32) -> i32`, found closure [INFO] [stdout] | [INFO] [stdout] = note: expected reference `&'static (dyn Fn(i32) -> i32 + 'static)` [INFO] [stdout] found closure `{closure@src/main.rs:6:9: 6:12}` [INFO] [stdout] help: consider borrowing here [INFO] [stdout] | [INFO] [stdout] 6 | &|x| x + num [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/main.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 10 | fn static_lifetime_specified_higher_order_function() -> &'static (Fn(i32) -> i32) { [INFO] [stdout] | ------------------------- expected `&'static (dyn Fn(i32) -> i32 + 'static)` because of return type [INFO] [stdout] ... [INFO] [stdout] 13 | |x| x + num [INFO] [stdout] | ^^^^^^^^^^^ expected `&dyn Fn(i32) -> i32`, found closure [INFO] [stdout] | [INFO] [stdout] = note: expected reference `&'static (dyn Fn(i32) -> i32 + 'static)` [INFO] [stdout] found closure `{closure@src/main.rs:13:9: 13:12}` [INFO] [stdout] help: consider borrowing here [INFO] [stdout] | [INFO] [stdout] 13 | &|x| x + num [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/main.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 10 | fn static_lifetime_specified_higher_order_function() -> &'static (Fn(i32) -> i32) { [INFO] [stdout] | ------------------------- expected `&'static (dyn Fn(i32) -> i32 + 'static)` because of return type [INFO] [stdout] ... [INFO] [stdout] 13 | |x| x + num [INFO] [stdout] | ^^^^^^^^^^^ expected `&dyn Fn(i32) -> i32`, found closure [INFO] [stdout] | [INFO] [stdout] = note: expected reference `&'static (dyn Fn(i32) -> i32 + 'static)` [INFO] [stdout] found closure `{closure@src/main.rs:13:9: 13:12}` [INFO] [stdout] help: consider borrowing here [INFO] [stdout] | [INFO] [stdout] 13 | &|x| x + num [INFO] [stdout] | + [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0373]: closure may outlive the current function, but it borrows `num`, which is owned by the current function [INFO] [stdout] --> src/main.rs:20:18 [INFO] [stdout] | [INFO] [stdout] 20 | Box::new(|x| x + num) [INFO] [stdout] | ^^^ --- `num` is borrowed here [INFO] [stdout] | | [INFO] [stdout] | may outlive borrowed value `num` [INFO] [stdout] | [INFO] [stdout] note: closure is returned here [INFO] [stdout] --> src/main.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | Box::new(|x| x + num) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] help: to force the closure to take ownership of `num` (and any other referenced variables), use the `move` keyword [INFO] [stdout] | [INFO] [stdout] 20 | Box::new(move |x| x + num) [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0373]: closure may outlive the current function, but it borrows `num`, which is owned by the current function [INFO] [stdout] --> src/main.rs:20:18 [INFO] [stdout] | [INFO] [stdout] 20 | Box::new(|x| x + num) [INFO] [stdout] | ^^^ --- `num` is borrowed here [INFO] [stdout] | | [INFO] [stdout] | may outlive borrowed value `num` [INFO] [stdout] | [INFO] [stdout] note: closure is returned here [INFO] [stdout] --> src/main.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | Box::new(|x| x + num) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] help: to force the closure to take ownership of `num` (and any other referenced variables), use the `move` keyword [INFO] [stdout] | [INFO] [stdout] 20 | Box::new(move |x| x + num) [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to 4 previous errors [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0106, E0308, E0373. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0106`. [INFO] [stdout] [INFO] [stdout] error: aborting due to 4 previous errors [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] Some errors have detailed explanations: E0106, E0308, E0373. [INFO] [stdout] [INFO] [stdout] For more information about an error, try `rustc --explain E0106`. [INFO] [stdout] [INFO] [stderr] error: could not compile `rust-closures-playground` (bin "rust-closures-playground") due to 5 previous errors [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: could not compile `rust-closures-playground` (bin "rust-closures-playground" test) due to 5 previous errors [INFO] running `Command { std: "docker" "inspect" "9eec681a305ef7e07762d7bff694696b60902830d3a3f99f627d0d062a2eb46b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9eec681a305ef7e07762d7bff694696b60902830d3a3f99f627d0d062a2eb46b", kill_on_drop: false }` [INFO] [stdout] 9eec681a305ef7e07762d7bff694696b60902830d3a3f99f627d0d062a2eb46b