[INFO] cloning repository https://github.com/leecobaby/study-rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/leecobaby/study-rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fleecobaby%2Fstudy-rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fleecobaby%2Fstudy-rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] d7cb5e178d0d2d6794201af8b33d067ab635bef3 [INFO] testing leecobaby/study-rust against master#733b47ea4b1b86216f14ef56e49440c33933f230+rustflags=-Copt-level=3 for pr-138759-retry [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fleecobaby%2Fstudy-rust" "/workspace/builds/worker-6-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-6-tc2/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/leecobaby/study-rust [INFO] finished tweaking git repo https://github.com/leecobaby/study-rust [INFO] tweaked toml for git repo https://github.com/leecobaby/study-rust written to /workspace/builds/worker-6-tc2/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/leecobaby/study-rust on toolchain 733b47ea4b1b86216f14ef56e49440c33933f230 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+733b47ea4b1b86216f14ef56e49440c33933f230" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/leecobaby/study-rust 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" "+733b47ea4b1b86216f14ef56e49440c33933f230" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: unused manifest key: profiles [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+733b47ea4b1b86216f14ef56e49440c33933f230" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] ff6fc9f91fb54a474e1f02339494312b0b70ee75aa84eb6160116d104e9e461e [INFO] running `Command { std: "docker" "start" "-a" "ff6fc9f91fb54a474e1f02339494312b0b70ee75aa84eb6160116d104e9e461e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "ff6fc9f91fb54a474e1f02339494312b0b70ee75aa84eb6160116d104e9e461e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "ff6fc9f91fb54a474e1f02339494312b0b70ee75aa84eb6160116d104e9e461e", kill_on_drop: false }` [INFO] [stdout] ff6fc9f91fb54a474e1f02339494312b0b70ee75aa84eb6160116d104e9e461e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-6-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 -Copt-level=3" "-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:e90291280db7d1fac5b66fc6dad9f9662629e7365a55743daf9bdf73ebc4ea79" "/opt/rustwide/cargo-home/bin/cargo" "+733b47ea4b1b86216f14ef56e49440c33933f230" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 7bf088668eaec8cf9f3c64536356eca11f964f388091857634130b84ea95f648 [INFO] running `Command { std: "docker" "start" "-a" "7bf088668eaec8cf9f3c64536356eca11f964f388091857634130b84ea95f648", kill_on_drop: false }` [INFO] [stderr] warning: unused manifest key: profiles [INFO] [stderr] Compiling libc v0.2.139 [INFO] [stderr] Compiling rand_core v0.4.2 [INFO] [stderr] Compiling rand_core v0.3.1 [INFO] [stderr] Compiling rand v0.5.6 [INFO] [stderr] Compiling study_rust v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/bin/19-4.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | let v = Status::Value(3); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `list_of_statuses` [INFO] [stdout] --> src/bin/19-4.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | let list_of_statuses: Vec = (0u32..20).map(Status::Value).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_list_of_statuses` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/bin/19-4.rs:17:15 [INFO] [stdout] | [INFO] [stdout] 17 | Value(u32), [INFO] [stdout] | ----- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 17 - Value(u32), [INFO] [stdout] 17 + Value(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `Stop` is never constructed [INFO] [stdout] --> src/bin/19-4.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 16 | enum Status { [INFO] [stdout] | ------ variant in this enum [INFO] [stdout] 17 | Value(u32), [INFO] [stdout] 18 | Stop, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `returns_closure` is never used [INFO] [stdout] --> src/bin/19-4.rs:39:4 [INFO] [stdout] | [INFO] [stdout] 39 | fn returns_closure() -> Box i32> { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0004]: non-exhaustive patterns: `Message::Quit`, `Message::Move { .. }`, `Message::Write(_)` and 1 more not covered [INFO] [stdout] --> src/bin/18-3.rs:145:11 [INFO] [stdout] | [INFO] [stdout] 145 | match msg { [INFO] [stdout] | ^^^ patterns `Message::Quit`, `Message::Move { .. }`, `Message::Write(_)` and 1 more not covered [INFO] [stdout] | [INFO] [stdout] note: `Message` defined here [INFO] [stdout] --> src/bin/18-3.rs:166:6 [INFO] [stdout] | [INFO] [stdout] 166 | enum Message { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 167 | Quit, [INFO] [stdout] | ---- not covered [INFO] [stdout] 168 | Move { x: i32, y: i32 }, [INFO] [stdout] | ---- not covered [INFO] [stdout] 169 | Write(String), [INFO] [stdout] | ----- not covered [INFO] [stdout] 170 | ChangeColor(i32, i32, i32), [INFO] [stdout] | ----------- not covered [INFO] [stdout] = note: the matched value is of type `Message` [INFO] [stdout] help: ensure that all possible cases are being handled by adding a match arm with a wildcard pattern as shown, or multiple match arms [INFO] [stdout] | [INFO] [stdout] 157 ~ }, [INFO] [stdout] 158 + _ => todo!() [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0004`. [INFO] [stdout] [INFO] [stdout] error[E0601]: `main` function not found in crate `pool` [INFO] [stdout] --> src/bin/pool.rs:22:2 [INFO] [stdout] | [INFO] [stdout] 22 | } [INFO] [stdout] | ^ consider adding a `main` function to `src/bin/pool.rs` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/bin/pool.rs:17:30 [INFO] [stdout] | [INFO] [stdout] 17 | pub fn execute(&self, f: F) [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0382]: borrow of moved value: `x` [INFO] [stdout] --> src/bin/13-4.rs:17:40 [INFO] [stdout] | [INFO] [stdout] 13 | let x = vec![1, 2, 3]; [INFO] [stdout] | - move occurs because `x` has type `Vec`, which does not implement the `Copy` trait [INFO] [stdout] 14 | [INFO] [stdout] 15 | let equal_to_x = move |z| z == x; [INFO] [stdout] | -------- - variable moved due to use in closure [INFO] [stdout] | | [INFO] [stdout] | value moved into closure here [INFO] [stdout] 16 | [INFO] [stdout] 17 | println!("can't use x here: {:?}", x); [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 before moving it into the closure [INFO] [stdout] | [INFO] [stdout] 15 ~ let value = x.clone(); [INFO] [stdout] 16 ~ let equal_to_x = move |z| z == value; [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0382`. [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0601`. [INFO] [stdout] [INFO] [stderr] error: could not compile `study_rust` (bin "13-4") due to 1 previous error [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stderr] error: could not compile `study_rust` (bin "18-3") due to 1 previous error [INFO] [stdout] error[E0381]: used binding `buffer` isn't initialized [INFO] [stdout] --> src/bin/13-10.rs:12:18 [INFO] [stdout] | [INFO] [stdout] 8 | let buffer: &mut [i32]; [INFO] [stdout] | ------ binding declared here but left uninitialized [INFO] [stdout] ... [INFO] [stdout] 12 | for i in 12..buffer.len() { [INFO] [stdout] | ^^^^^^ `*buffer` used here but it isn't initialized [INFO] [stdout] | [INFO] [stdout] help: consider assigning a value [INFO] [stdout] | [INFO] [stdout] 8 | let buffer: &mut [i32] = &mut []; [INFO] [stdout] | +++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0601]: `main` function not found in crate `11_8` [INFO] [stdout] --> src/bin/11-8.rs:19:2 [INFO] [stdout] | [INFO] [stdout] 19 | } [INFO] [stdout] | ^ consider adding a `main` function to `src/bin/11-8.rs` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0381]: used binding `coefficients` isn't initialized [INFO] [stdout] --> src/bin/13-10.rs:13:26 [INFO] [stdout] | [INFO] [stdout] 9 | let coefficients: [i64; 12]; [INFO] [stdout] | ------------ binding declared here but left uninitialized [INFO] [stdout] ... [INFO] [stdout] 13 | let prediction = coefficients [INFO] [stdout] | ^^^^^^^^^^^^ `coefficients` used here but it isn't initialized [INFO] [stdout] | [INFO] [stdout] help: consider assigning a value [INFO] [stdout] | [INFO] [stdout] 9 | let coefficients: [i64; 12] = [42; 12]; [INFO] [stdout] | ++++++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0381]: used binding `qlp_shift` isn't initialized [INFO] [stdout] --> src/bin/13-10.rs:18:16 [INFO] [stdout] | [INFO] [stdout] 10 | let qlp_shift: i16; [INFO] [stdout] | --------- binding declared here but left uninitialized [INFO] [stdout] ... [INFO] [stdout] 18 | >> qlp_shift; [INFO] [stdout] | ^^^^^^^^^ `qlp_shift` used here but it isn't initialized [INFO] [stdout] | [INFO] [stdout] help: consider assigning a value [INFO] [stdout] | [INFO] [stdout] 10 | let qlp_shift: i16 = 42; [INFO] [stdout] | ++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `OpenOptions` [INFO] [stdout] --> src/bin/9-2.rs:3:21 [INFO] [stdout] | [INFO] [stdout] 3 | use std::fs::{File, OpenOptions}; [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::io` [INFO] [stdout] --> src/bin/9-2.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::io; [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0601`. [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0381`. [INFO] [stdout] [INFO] [stderr] error: could not compile `study_rust` (bin "pool") due to 1 previous error; 1 warning emitted [INFO] [stdout] error[E0583]: file not found for module `hosting` [INFO] [stdout] --> src/bin/demo_module.rs:1:1 [INFO] [stdout] | [INFO] [stdout] 1 | pub mod hosting; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: to create the module `hosting`, create file "src/bin/demo_module/hosting.rs" or "src/bin/demo_module/hosting/mod.rs" [INFO] [stdout] = note: if there is a `mod hosting` elsewhere in the crate already, import it with `use crate::...` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0106]: missing lifetime specifier [INFO] [stdout] --> src/bin/4-2.rs:30:16 [INFO] [stdout] | [INFO] [stdout] 30 | fn dangle() -> &String { // 编译器会报错 [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] 30 | fn dangle() -> &'static String { // 编译器会报错 [INFO] [stdout] | +++++++ [INFO] [stdout] help: instead, you are more likely to want to return an owned value [INFO] [stdout] | [INFO] [stdout] 30 - fn dangle() -> &String { // 编译器会报错 [INFO] [stdout] 30 + fn dangle() -> String { // 编译器会报错 [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0583`. [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> src/bin/9-2.rs:33:9 [INFO] [stdout] | [INFO] [stdout] 33 | let b = match &f { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/bin/9-2.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | let f = File::open("hello.txt").unwrap(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/bin/9-2.rs:68:9 [INFO] [stdout] | [INFO] [stdout] 68 | let f = File::open("hello.txt").expect("Failed to open hello.txt"); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0716]: temporary value dropped while borrowed [INFO] [stdout] --> src/bin/9-2.rs:37:43 [INFO] [stdout] | [INFO] [stdout] 35 | Err(error) => match error.kind() { [INFO] [stdout] | _______________________- [INFO] [stdout] 36 | | // TODO: 局部作用域的借用会出错 [INFO] [stdout] 37 | | ErrorKind::NotFound => match &File::create("hello.txt") { [INFO] [stdout] | | ^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use [INFO] [stdout] 38 | | Ok(fc) => fc, [INFO] [stdout] 39 | | Err(e) => panic!("Tried to create file but there was a problem: {:?}", e), [INFO] [stdout] 40 | | }, [INFO] [stdout] | | - temporary value is freed at the end of this statement [INFO] [stdout] ... | [INFO] [stdout] 44 | | }, [INFO] [stdout] | |_________- borrow later used here [INFO] [stdout] | [INFO] [stdout] help: consider using a `let` binding to create a longer lived value [INFO] [stdout] | [INFO] [stdout] 33 ~ let binding = File::create("hello.txt"); [INFO] [stdout] 34 ~ let b = match &f { [INFO] [stdout] 35 | Ok(file) => file, [INFO] [stdout] 36 | Err(error) => match error.kind() { [INFO] [stdout] 37 | // TODO: 局部作用域的借用会出错 [INFO] [stdout] 38 ~ ErrorKind::NotFound => match &binding { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `study_rust` (bin "13-10") due to 3 previous errors [INFO] [stderr] error: could not compile `study_rust` (bin "11-8") due to 1 previous error [INFO] [stdout] For more information about this error, try `rustc --explain E0716`. [INFO] [stdout] [INFO] [stderr] error: could not compile `study_rust` (bin "9-2") due to 1 previous error; 5 warnings emitted [INFO] [stderr] error: could not compile `study_rust` (bin "7-6") due to 1 previous error [INFO] [stdout] For more information about this error, try `rustc --explain E0106`. [INFO] [stdout] [INFO] [stderr] error: could not compile `study_rust` (bin "4-2") due to 1 previous error [INFO] [stdout] error[E0308]: mismatched types [INFO] [stdout] --> src/bin/13-2.rs:7:29 [INFO] [stdout] | [INFO] [stdout] 7 | let n = example_closure(5); [INFO] [stdout] | --------------- ^- help: try using a conversion method: `.to_string()` [INFO] [stdout] | | | [INFO] [stdout] | | expected `String`, found integer [INFO] [stdout] | arguments to this function are incorrect [INFO] [stdout] | [INFO] [stdout] note: expected because the closure was earlier called with an argument of type `String` [INFO] [stdout] --> src/bin/13-2.rs:4:29 [INFO] [stdout] | [INFO] [stdout] 4 | let s = example_closure(String::from("hello")); [INFO] [stdout] | --------------- ^^^^^^^^^^^^^^^^^^^^^ expected because this argument is of type `String` [INFO] [stdout] | | [INFO] [stdout] | in this closure call [INFO] [stdout] note: closure parameter defined here [INFO] [stdout] --> src/bin/13-2.rs:2:28 [INFO] [stdout] | [INFO] [stdout] 2 | let example_closure = |x| x; [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused return value of `from` that must be used [INFO] [stdout] --> src/bin/10-3.rs:11:9 [INFO] [stdout] | [INFO] [stdout] 11 | String::from("(Read more...)"); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 11 | let _ = String::from("(Read more...)"); [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0308`. [INFO] [stdout] [INFO] [stderr] error: could not compile `study_rust` (bin "13-2") due to 1 previous error [INFO] running `Command { std: "docker" "inspect" "7bf088668eaec8cf9f3c64536356eca11f964f388091857634130b84ea95f648", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "7bf088668eaec8cf9f3c64536356eca11f964f388091857634130b84ea95f648", kill_on_drop: false }` [INFO] [stdout] 7bf088668eaec8cf9f3c64536356eca11f964f388091857634130b84ea95f648