[INFO] cloning repository https://github.com/SunTiebing/learn_rust [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/SunTiebing/learn_rust" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSunTiebing%2Flearn_rust", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSunTiebing%2Flearn_rust'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 60b3ffe529bd24bd66aaf5c21b9217f1af2b1556 [INFO] testing SunTiebing/learn_rust/60b3ffe529bd24bd66aaf5c21b9217f1af2b1556 against beta-2024-10-19 for beta-1.83-1 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2FSunTiebing%2Flearn_rust" "/workspace/builds/worker-2-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/SunTiebing/learn_rust on toolchain beta-2024-10-19 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+beta-2024-10-19" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/SunTiebing/learn_rust [INFO] finished tweaking git repo https://github.com/SunTiebing/learn_rust [INFO] tweaked toml for git repo https://github.com/SunTiebing/learn_rust written to /workspace/builds/worker-2-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/SunTiebing/learn_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" "+beta-2024-10-19" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [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-2-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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:4a844ea9eb2546a2d2c7022eacef16ef2e8229c7fbb2c7d4d55a9ceca922f72d" "/opt/rustwide/cargo-home/bin/cargo" "+beta-2024-10-19" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] c49a0603d6a5cb126ec22668094b0884efeffb5d497d7cdd8582ed9045ad6221 [INFO] running `Command { std: "docker" "start" "-a" "c49a0603d6a5cb126ec22668094b0884efeffb5d497d7cdd8582ed9045ad6221", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "c49a0603d6a5cb126ec22668094b0884efeffb5d497d7cdd8582ed9045ad6221", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "c49a0603d6a5cb126ec22668094b0884efeffb5d497d7cdd8582ed9045ad6221", kill_on_drop: false }` [INFO] [stdout] c49a0603d6a5cb126ec22668094b0884efeffb5d497d7cdd8582ed9045ad6221 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-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" "+beta-2024-10-19" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] a7223e4a27e88e931095b611d5ff4656850d7eb121032d365120acd91ff71433 [INFO] running `Command { std: "docker" "start" "-a" "a7223e4a27e88e931095b611d5ff4656850d7eb121032d365120acd91ff71433", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] Compiling proc-macro2 v1.0.47 [INFO] [stderr] Compiling unicode-ident v1.0.5 [INFO] [stderr] Compiling quote v1.0.21 [INFO] [stderr] Compiling syn v1.0.103 [INFO] [stderr] Compiling libc v0.2.137 [INFO] [stderr] Compiling futures-core v0.3.25 [INFO] [stderr] Compiling futures-task v0.3.25 [INFO] [stderr] Compiling futures-channel v0.3.25 [INFO] [stderr] Compiling futures-util v0.3.25 [INFO] [stderr] Compiling futures-sink v0.3.25 [INFO] [stderr] Compiling futures-io v0.3.25 [INFO] [stderr] Compiling thread_pool v0.1.0 (/opt/rustwide/workdir/thread_pool) [INFO] [stderr] Compiling minigrep v0.1.0 (/opt/rustwide/workdir/minigrep) [INFO] [stderr] Compiling hello_cargo v0.1.0 (/opt/rustwide/workdir/hello_cargo) [INFO] [stderr] Compiling rust_course v0.1.0 (/opt/rustwide/workdir/rust_course) [INFO] [stdout] warning: unused import: `Read` [INFO] [stdout] --> hello_cargo/src/main.rs:3:27 [INFO] [stdout] | [INFO] [stdout] 3 | io::{self, ErrorKind, Read}, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s2` [INFO] [stdout] --> hello_cargo/src/main.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | let s2 = Student { number: 2, ..s1 }; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s2` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> hello_cargo/src/main.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | let f = match file { [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] --> hello_cargo/src/main.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let f = File::open("hello.txt").unwrap(); // 不可以自定义panic [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] --> hello_cargo/src/main.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | let f = File::open("hello.txt").expect("Error opening file"); //可以自定义panic [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] --> hello_cargo/src/main.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | let f = match file { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `file` [INFO] [stdout] --> hello_cargo/src/main.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | let file = File::open("hello.txt").unwrap_or_else(|error| { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_file` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> hello_cargo/src/main.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | let f = match File::open("hello.txt") { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `name`, `age`, and `number` are never read [INFO] [stdout] --> hello_cargo/src/main.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 12 | struct Student { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] 13 | name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] 14 | age: i128, [INFO] [stdout] | ^^^ [INFO] [stdout] 15 | number: i128, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Rectangle` is never constructed [INFO] [stdout] --> hello_cargo/src/main.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | struct Rectangle { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_workout` is never used [INFO] [stdout] --> minigrep/src/lib.rs:73:4 [INFO] [stdout] | [INFO] [stdout] 73 | fn generate_workout(intensity: u32, random_number: u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `area`, `can_hold`, and `square` are never used [INFO] [stdout] --> hello_cargo/src/main.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 36 | impl Rectangle { [INFO] [stdout] | -------------- associated items in this implementation [INFO] [stdout] 37 | fn area(&self) -> u128 { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 41 | fn can_hold(&self, other: &Rectangle) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 45 | fn square(size: u128) -> Rectangle { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_file` is never used [INFO] [stdout] --> hello_cargo/src/main.rs:53:4 [INFO] [stdout] | [INFO] [stdout] 53 | fn read_file() { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `open_file` is never used [INFO] [stdout] --> hello_cargo/src/main.rs:92:4 [INFO] [stdout] | [INFO] [stdout] 92 | fn open_file() -> Result { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cacher` is never constructed [INFO] [stdout] --> minigrep/src/lib.rs:104:8 [INFO] [stdout] | [INFO] [stdout] 104 | struct Cacher [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `value` are never used [INFO] [stdout] --> minigrep/src/lib.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 112 | / impl Cacher [INFO] [stdout] 113 | | where [INFO] [stdout] 114 | | T: Fn(u32) -> u32, [INFO] [stdout] | |______________________- associated items in this implementation [INFO] [stdout] 115 | { [INFO] [stdout] 116 | fn new(calculation: T) -> Cacher { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 123 | fn value(&mut self, args: u32) -> u32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `move_test` is never used [INFO] [stdout] --> minigrep/src/lib.rs:136:4 [INFO] [stdout] | [INFO] [stdout] 136 | fn move_test() { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Course` is never constructed [INFO] [stdout] --> rust_course/src/course_three/course.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Course { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Course` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `add_student`, `remove_student`, and `new` are never used [INFO] [stdout] --> rust_course/src/course_three/course.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 9 | impl Course { [INFO] [stdout] | ----------- associated items in this implementation [INFO] [stdout] 10 | pub fn add_student(&mut self, student: Student) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 14 | pub fn remove_student(&mut self, name: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 22 | pub fn new(name: String, students: Vec) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Society` is never constructed [INFO] [stdout] --> rust_course/src/course_three/society.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Society { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Society` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `change_name`, `add_student`, `remove_student`, and `new` are never used [INFO] [stdout] --> rust_course/src/course_three/society.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 9 | impl Society { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] 10 | pub fn change_name(&mut self, name: String) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 14 | pub fn add_student(&mut self, student: Student) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 18 | pub fn remove_student(&mut self, name: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 26 | pub fn new(name: String, members: Vec) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `name`, `age`, and `class` are never read [INFO] [stdout] --> rust_course/src/course_three/student.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct Student { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] 8 | pub num: u32, [INFO] [stdout] 9 | pub name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] 10 | pub age: u32, [INFO] [stdout] | ^^^ [INFO] [stdout] 11 | pub class: Option, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Student` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `change_name`, `change_age`, `change_class`, and `dismiss_student` are never used [INFO] [stdout] --> rust_course/src/course_three/student.rs:30:12 [INFO] [stdout] | [INFO] [stdout] 14 | impl Student { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 30 | pub fn change_name(&mut self, name: String) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 34 | pub fn change_age(&mut self, age: u32) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 38 | pub fn change_class(&mut self, class: Class) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 52 | pub fn dismiss_student(id: u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/main.rs:25:45 [INFO] [stdout] | [INFO] [stdout] 25 | unsafe { println!("all students: {:?}", STUDENTS) } [INFO] [stdout] | ^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/class.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | CLASSES.push(class.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/class.rs:57:19 [INFO] [stdout] | [INFO] [stdout] 57 | match CLASSES.iter().position(|class| class.num == class_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/class.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | CLASSES.remove(index); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | STUDENTS.push(student.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:44:32 [INFO] [stdout] | [INFO] [stdout] 44 | if let Some(stu) = STUDENTS.iter().find(|&s| s.num == id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:54:19 [INFO] [stdout] | [INFO] [stdout] 54 | match STUDENTS.iter().position(|stu| stu.num == id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:57:21 [INFO] [stdout] | [INFO] [stdout] 57 | STUDENTS.remove(index); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling getrandom v0.2.8 [INFO] [stderr] Compiling rand_core v0.6.4 [INFO] [stderr] Compiling rand_chacha v0.3.1 [INFO] [stderr] Compiling rand v0.8.5 [INFO] [stderr] Compiling guessing_game v0.1.0 (/opt/rustwide/workdir/guessing_game) [INFO] [stderr] Compiling futures-macro v0.3.25 [INFO] [stderr] Compiling futures-executor v0.3.25 [INFO] [stderr] Compiling futures v0.3.25 [INFO] [stderr] Compiling rust_async v0.1.0 (/opt/rustwide/workdir/rust_async) [INFO] [stderr] Finished `dev` profile [unoptimized + debuginfo] target(s) in 14.18s [INFO] running `Command { std: "docker" "inspect" "a7223e4a27e88e931095b611d5ff4656850d7eb121032d365120acd91ff71433", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "a7223e4a27e88e931095b611d5ff4656850d7eb121032d365120acd91ff71433", kill_on_drop: false }` [INFO] [stdout] a7223e4a27e88e931095b611d5ff4656850d7eb121032d365120acd91ff71433 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-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" "+beta-2024-10-19" "test" "--frozen" "--no-run" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 9a000658875a6991275d9eb7a5e282b235b31cfbad6fd5cb5518c26fc148983e [INFO] running `Command { std: "docker" "start" "-a" "9a000658875a6991275d9eb7a5e282b235b31cfbad6fd5cb5518c26fc148983e", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] Compiling thread_pool v0.1.0 (/opt/rustwide/workdir/thread_pool) [INFO] [stderr] Compiling minigrep v0.1.0 (/opt/rustwide/workdir/minigrep) [INFO] [stderr] Compiling rust_course v0.1.0 (/opt/rustwide/workdir/rust_course) [INFO] [stdout] warning: function `generate_workout` is never used [INFO] [stdout] --> minigrep/src/lib.rs:73:4 [INFO] [stdout] | [INFO] [stdout] 73 | fn generate_workout(intensity: u32, random_number: u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cacher` is never constructed [INFO] [stdout] --> minigrep/src/lib.rs:104:8 [INFO] [stdout] | [INFO] [stdout] 104 | struct Cacher [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `value` are never used [INFO] [stdout] --> minigrep/src/lib.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 112 | / impl Cacher [INFO] [stdout] 113 | | where [INFO] [stdout] 114 | | T: Fn(u32) -> u32, [INFO] [stdout] | |______________________- associated items in this implementation [INFO] [stdout] 115 | { [INFO] [stdout] 116 | fn new(calculation: T) -> Cacher { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 123 | fn value(&mut self, args: u32) -> u32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `move_test` is never used [INFO] [stdout] --> minigrep/src/lib.rs:136:4 [INFO] [stdout] | [INFO] [stdout] 136 | fn move_test() { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Compiling hello_cargo v0.1.0 (/opt/rustwide/workdir/hello_cargo) [INFO] [stderr] Compiling guessing_game v0.1.0 (/opt/rustwide/workdir/guessing_game) [INFO] [stderr] Compiling rust_async v0.1.0 (/opt/rustwide/workdir/rust_async) [INFO] [stdout] warning: unused import: `Read` [INFO] [stdout] --> hello_cargo/src/main.rs:3:27 [INFO] [stdout] | [INFO] [stdout] 3 | io::{self, ErrorKind, Read}, [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s2` [INFO] [stdout] --> hello_cargo/src/main.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | let s2 = Student { number: 2, ..s1 }; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s2` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> hello_cargo/src/main.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | let f = match file { [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] --> hello_cargo/src/main.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let f = File::open("hello.txt").unwrap(); // 不可以自定义panic [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] --> hello_cargo/src/main.rs:63:9 [INFO] [stdout] | [INFO] [stdout] 63 | let f = File::open("hello.txt").expect("Error opening file"); //可以自定义panic [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] --> hello_cargo/src/main.rs:67:9 [INFO] [stdout] | [INFO] [stdout] 67 | let f = match file { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `file` [INFO] [stdout] --> hello_cargo/src/main.rs:81:9 [INFO] [stdout] | [INFO] [stdout] 81 | let file = File::open("hello.txt").unwrap_or_else(|error| { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_file` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> hello_cargo/src/main.rs:94:9 [INFO] [stdout] | [INFO] [stdout] 94 | let f = match File::open("hello.txt") { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Rectangle` is never constructed [INFO] [stdout] --> hello_cargo/src/main.rs:31:8 [INFO] [stdout] | [INFO] [stdout] 31 | struct Rectangle { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `area`, `can_hold`, and `square` are never used [INFO] [stdout] --> hello_cargo/src/main.rs:37:8 [INFO] [stdout] | [INFO] [stdout] 36 | impl Rectangle { [INFO] [stdout] | -------------- associated items in this implementation [INFO] [stdout] 37 | fn area(&self) -> u128 { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 41 | fn can_hold(&self, other: &Rectangle) -> bool { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 45 | fn square(size: u128) -> Rectangle { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `read_file` is never used [INFO] [stdout] --> hello_cargo/src/main.rs:53:4 [INFO] [stdout] | [INFO] [stdout] 53 | fn read_file() { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `open_file` is never used [INFO] [stdout] --> hello_cargo/src/main.rs:92:4 [INFO] [stdout] | [INFO] [stdout] 92 | fn open_file() -> Result { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v5` [INFO] [stdout] --> minigrep/src/lib.rs:173:13 [INFO] [stdout] | [INFO] [stdout] 173 | let v5: i32 = v1 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_v5` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> minigrep/src/lib.rs:154:13 [INFO] [stdout] | [INFO] [stdout] 154 | let mut v1 = vec![1, 2, 3]; [INFO] [stdout] | ----^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> minigrep/src/lib.rs:155:13 [INFO] [stdout] | [INFO] [stdout] 155 | let mut v2: Vec = v1.iter().map(|x| x + 1).collect(); [INFO] [stdout] | ----^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `generate_workout` is never used [INFO] [stdout] --> minigrep/src/lib.rs:73:4 [INFO] [stdout] | [INFO] [stdout] 73 | fn generate_workout(intensity: u32, random_number: u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cacher` is never constructed [INFO] [stdout] --> minigrep/src/lib.rs:104:8 [INFO] [stdout] | [INFO] [stdout] 104 | struct Cacher [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `value` are never used [INFO] [stdout] --> minigrep/src/lib.rs:116:8 [INFO] [stdout] | [INFO] [stdout] 112 | / impl Cacher [INFO] [stdout] 113 | | where [INFO] [stdout] 114 | | T: Fn(u32) -> u32, [INFO] [stdout] | |______________________- associated items in this implementation [INFO] [stdout] 115 | { [INFO] [stdout] 116 | fn new(calculation: T) -> Cacher { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 123 | fn value(&mut self, args: u32) -> u32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `move_test` is never used [INFO] [stdout] --> minigrep/src/lib.rs:136:4 [INFO] [stdout] | [INFO] [stdout] 136 | fn move_test() { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Course` is never constructed [INFO] [stdout] --> rust_course/src/course_three/course.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Course { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Course` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `add_student`, `remove_student`, and `new` are never used [INFO] [stdout] --> rust_course/src/course_three/course.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 9 | impl Course { [INFO] [stdout] | ----------- associated items in this implementation [INFO] [stdout] 10 | pub fn add_student(&mut self, student: Student) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 14 | pub fn remove_student(&mut self, name: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 22 | pub fn new(name: String, students: Vec) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Society` is never constructed [INFO] [stdout] --> rust_course/src/course_three/society.rs:4:12 [INFO] [stdout] | [INFO] [stdout] 4 | pub struct Society { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Society` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `change_name`, `add_student`, `remove_student`, and `new` are never used [INFO] [stdout] --> rust_course/src/course_three/society.rs:10:12 [INFO] [stdout] | [INFO] [stdout] 9 | impl Society { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] 10 | pub fn change_name(&mut self, name: String) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 14 | pub fn add_student(&mut self, student: Student) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 18 | pub fn remove_student(&mut self, name: String) -> bool { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 26 | pub fn new(name: String, members: Vec) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `name`, `age`, and `class` are never read [INFO] [stdout] --> rust_course/src/course_three/student.rs:9:9 [INFO] [stdout] | [INFO] [stdout] 7 | pub struct Student { [INFO] [stdout] | ------- fields in this struct [INFO] [stdout] 8 | pub num: u32, [INFO] [stdout] 9 | pub name: String, [INFO] [stdout] | ^^^^ [INFO] [stdout] 10 | pub age: u32, [INFO] [stdout] | ^^^ [INFO] [stdout] 11 | pub class: Option, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Student` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `change_name`, `change_age`, `change_class`, and `dismiss_student` are never used [INFO] [stdout] --> rust_course/src/course_three/student.rs:30:12 [INFO] [stdout] | [INFO] [stdout] 14 | impl Student { [INFO] [stdout] | ------------ associated items in this implementation [INFO] [stdout] ... [INFO] [stdout] 30 | pub fn change_name(&mut self, name: String) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 34 | pub fn change_age(&mut self, age: u32) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 38 | pub fn change_class(&mut self, class: Class) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 52 | pub fn dismiss_student(id: u32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/main.rs:25:45 [INFO] [stdout] | [INFO] [stdout] 25 | unsafe { println!("all students: {:?}", STUDENTS) } [INFO] [stdout] | ^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/class.rs:23:13 [INFO] [stdout] | [INFO] [stdout] 23 | CLASSES.push(class.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/class.rs:57:19 [INFO] [stdout] | [INFO] [stdout] 57 | match CLASSES.iter().position(|class| class.num == class_id) { [INFO] [stdout] | ^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/class.rs:60:21 [INFO] [stdout] | [INFO] [stdout] 60 | CLASSES.remove(index); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | STUDENTS.push(student.clone()); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:44:32 [INFO] [stdout] | [INFO] [stdout] 44 | if let Some(stu) = STUDENTS.iter().find(|&s| s.num == id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a shared reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:54:19 [INFO] [stdout] | [INFO] [stdout] 54 | match STUDENTS.iter().position(|stu| stu.num == id) { [INFO] [stdout] | ^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: creating a mutable reference to mutable static is discouraged [INFO] [stdout] --> rust_course/src/course_three/student.rs:57:21 [INFO] [stdout] | [INFO] [stdout] 57 | STUDENTS.remove(index); [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stdout] | [INFO] [stdout] = note: for more information, see [INFO] [stdout] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 2.47s [INFO] running `Command { std: "docker" "inspect" "9a000658875a6991275d9eb7a5e282b235b31cfbad6fd5cb5518c26fc148983e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "9a000658875a6991275d9eb7a5e282b235b31cfbad6fd5cb5518c26fc148983e", kill_on_drop: false }` [INFO] [stdout] 9a000658875a6991275d9eb7a5e282b235b31cfbad6fd5cb5518c26fc148983e [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2-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=warn" "-e" "RUSTDOCFLAGS=--cap-lints=warn" "-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" "+beta-2024-10-19" "test" "--frozen", kill_on_drop: false }` [INFO] [stdout] aae9668c115870edfeb82448d41be99198264e4678426e784234ee6c1f69e85b [INFO] running `Command { std: "docker" "start" "-a" "aae9668c115870edfeb82448d41be99198264e4678426e784234ee6c1f69e85b", kill_on_drop: false }` [INFO] [stderr] warning: virtual workspace defaulting to `resolver = "1"` despite one or more workspace members being on edition 2021 which implies `resolver = "2"` [INFO] [stderr] note: to keep the current resolver, specify `workspace.resolver = "1"` in the workspace root's manifest [INFO] [stderr] note: to use the edition 2021 resolver, specify `workspace.resolver = "2"` in the workspace root's manifest [INFO] [stderr] note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions [INFO] [stderr] warning: function `generate_workout` is never used [INFO] [stderr] --> minigrep/src/lib.rs:73:4 [INFO] [stderr] | [INFO] [stderr] 73 | fn generate_workout(intensity: u32, random_number: u32) { [INFO] [stderr] | ^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(dead_code)]` on by default [INFO] [stderr] [INFO] [stderr] warning: struct `Cacher` is never constructed [INFO] [stderr] --> minigrep/src/lib.rs:104:8 [INFO] [stderr] | [INFO] [stderr] 104 | struct Cacher [INFO] [stderr] | ^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: associated items `new` and `value` are never used [INFO] [stderr] --> minigrep/src/lib.rs:116:8 [INFO] [stderr] | [INFO] [stderr] 112 | / impl Cacher [INFO] [stderr] 113 | | where [INFO] [stderr] 114 | | T: Fn(u32) -> u32, [INFO] [stderr] | |______________________- associated items in this implementation [INFO] [stderr] 115 | { [INFO] [stderr] 116 | fn new(calculation: T) -> Cacher { [INFO] [stderr] | ^^^ [INFO] [stderr] ... [INFO] [stderr] 123 | fn value(&mut self, args: u32) -> u32 { [INFO] [stderr] | ^^^^^ [INFO] [stderr] [INFO] [stderr] warning: function `move_test` is never used [INFO] [stderr] --> minigrep/src/lib.rs:136:4 [INFO] [stderr] | [INFO] [stderr] 136 | fn move_test() { [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: `minigrep` (lib) generated 4 warnings [INFO] [stderr] warning: unused variable: `v5` [INFO] [stderr] --> minigrep/src/lib.rs:173:13 [INFO] [stderr] | [INFO] [stderr] 173 | let v5: i32 = v1 [INFO] [stderr] | ^^ help: if this is intentional, prefix it with an underscore: `_v5` [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(unused_variables)]` on by default [INFO] [stderr] [INFO] [stderr] warning: variable does not need to be mutable [INFO] [stderr] --> minigrep/src/lib.rs:154:13 [INFO] [stderr] | [INFO] [stderr] 154 | let mut v1 = vec![1, 2, 3]; [INFO] [stderr] | ----^^ [INFO] [stderr] | | [INFO] [stderr] | help: remove this `mut` [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(unused_mut)]` on by default [INFO] [stderr] [INFO] [stderr] warning: variable does not need to be mutable [INFO] [stderr] --> minigrep/src/lib.rs:155:13 [INFO] [stderr] | [INFO] [stderr] 155 | let mut v2: Vec = v1.iter().map(|x| x + 1).collect(); [INFO] [stderr] | ----^^ [INFO] [stderr] | | [INFO] [stderr] | help: remove this `mut` [INFO] [stderr] [INFO] [stderr] warning: `minigrep` (lib test) generated 7 warnings (4 duplicates) (run `cargo fix --lib -p minigrep --tests` to apply 2 suggestions) [INFO] [stderr] warning: unused import: `Read` [INFO] [stderr] --> hello_cargo/src/main.rs:3:27 [INFO] [stderr] | [INFO] [stderr] 3 | io::{self, ErrorKind, Read}, [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(unused_imports)]` on by default [INFO] [stderr] [INFO] [stderr] warning: unused variable: `s2` [INFO] [stderr] --> hello_cargo/src/main.rs:28:9 [INFO] [stderr] | [INFO] [stderr] 28 | let s2 = Student { number: 2, ..s1 }; [INFO] [stderr] | ^^ help: if this is intentional, prefix it with an underscore: `_s2` [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(unused_variables)]` on by default [INFO] [stderr] [INFO] [stderr] warning: unused variable: `f` [INFO] [stderr] --> hello_cargo/src/main.rs:56:9 [INFO] [stderr] | [INFO] [stderr] 56 | let f = match file { [INFO] [stderr] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stderr] [INFO] [stderr] warning: unused variable: `f` [INFO] [stderr] --> hello_cargo/src/main.rs:62:9 [INFO] [stderr] | [INFO] [stderr] 62 | let f = File::open("hello.txt").unwrap(); // 不可以自定义panic [INFO] [stderr] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stderr] [INFO] [stderr] warning: unused variable: `f` [INFO] [stderr] --> hello_cargo/src/main.rs:63:9 [INFO] [stderr] | [INFO] [stderr] 63 | let f = File::open("hello.txt").expect("Error opening file"); //可以自定义panic [INFO] [stderr] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stderr] [INFO] [stderr] warning: unused variable: `f` [INFO] [stderr] --> hello_cargo/src/main.rs:67:9 [INFO] [stderr] | [INFO] [stderr] 67 | let f = match file { [INFO] [stderr] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stderr] [INFO] [stderr] warning: unused variable: `file` [INFO] [stderr] --> hello_cargo/src/main.rs:81:9 [INFO] [stderr] | [INFO] [stderr] 81 | let file = File::open("hello.txt").unwrap_or_else(|error| { [INFO] [stderr] | ^^^^ help: if this is intentional, prefix it with an underscore: `_file` [INFO] [stderr] [INFO] [stderr] warning: unused variable: `f` [INFO] [stderr] --> hello_cargo/src/main.rs:94:9 [INFO] [stderr] | [INFO] [stderr] 94 | let f = match File::open("hello.txt") { [INFO] [stderr] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stderr] [INFO] [stderr] warning: struct `Rectangle` is never constructed [INFO] [stderr] --> hello_cargo/src/main.rs:31:8 [INFO] [stderr] | [INFO] [stderr] 31 | struct Rectangle { [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `#[warn(dead_code)]` on by default [INFO] [stderr] [INFO] [stderr] warning: associated items `area`, `can_hold`, and `square` are never used [INFO] [stderr] --> hello_cargo/src/main.rs:37:8 [INFO] [stderr] | [INFO] [stderr] 36 | impl Rectangle { [INFO] [stderr] | -------------- associated items in this implementation [INFO] [stderr] 37 | fn area(&self) -> u128 { [INFO] [stderr] | ^^^^ [INFO] [stderr] ... [INFO] [stderr] 41 | fn can_hold(&self, other: &Rectangle) -> bool { [INFO] [stderr] | ^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 45 | fn square(size: u128) -> Rectangle { [INFO] [stderr] | ^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: function `read_file` is never used [INFO] [stderr] --> hello_cargo/src/main.rs:53:4 [INFO] [stderr] | [INFO] [stderr] 53 | fn read_file() { [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: function `open_file` is never used [INFO] [stderr] --> hello_cargo/src/main.rs:92:4 [INFO] [stderr] | [INFO] [stderr] 92 | fn open_file() -> Result { [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: struct `Course` is never constructed [INFO] [stderr] --> rust_course/src/course_three/course.rs:4:12 [INFO] [stderr] | [INFO] [stderr] 4 | pub struct Course { [INFO] [stderr] | ^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `Course` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stderr] = note: `#[warn(dead_code)]` on by default [INFO] [stderr] [INFO] [stderr] warning: associated items `add_student`, `remove_student`, and `new` are never used [INFO] [stderr] --> rust_course/src/course_three/course.rs:10:12 [INFO] [stderr] | [INFO] [stderr] 9 | impl Course { [INFO] [stderr] | ----------- associated items in this implementation [INFO] [stderr] 10 | pub fn add_student(&mut self, student: Student) { [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 14 | pub fn remove_student(&mut self, name: String) -> bool { [INFO] [stderr] | ^^^^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 22 | pub fn new(name: String, students: Vec) -> Self { [INFO] [stderr] | ^^^ [INFO] [stderr] [INFO] [stderr] warning: struct `Society` is never constructed [INFO] [stderr] --> rust_course/src/course_three/society.rs:4:12 [INFO] [stderr] | [INFO] [stderr] 4 | pub struct Society { [INFO] [stderr] | ^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `Society` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stderr] [INFO] [stderr] warning: associated items `change_name`, `add_student`, `remove_student`, and `new` are never used [INFO] [stderr] --> rust_course/src/course_three/society.rs:10:12 [INFO] [stderr] | [INFO] [stderr] 9 | impl Society { [INFO] [stderr] | ------------ associated items in this implementation [INFO] [stderr] 10 | pub fn change_name(&mut self, name: String) { [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 14 | pub fn add_student(&mut self, student: Student) { [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 18 | pub fn remove_student(&mut self, name: String) -> bool { [INFO] [stderr] | ^^^^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 26 | pub fn new(name: String, members: Vec) -> Self { [INFO] [stderr] | ^^^ [INFO] [stderr] [INFO] [stderr] warning: fields `name`, `age`, and `class` are never read [INFO] [stderr] --> rust_course/src/course_three/student.rs:9:9 [INFO] [stderr] | [INFO] [stderr] 7 | pub struct Student { [INFO] [stderr] | ------- fields in this struct [INFO] [stderr] 8 | pub num: u32, [INFO] [stderr] 9 | pub name: String, [INFO] [stderr] | ^^^^ [INFO] [stderr] 10 | pub age: u32, [INFO] [stderr] | ^^^ [INFO] [stderr] 11 | pub class: Option, [INFO] [stderr] | ^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: `Student` has derived impls for the traits `Clone` and `Debug`, but these are intentionally ignored during dead code analysis [INFO] [stderr] [INFO] [stderr] warning: associated items `change_name`, `change_age`, `change_class`, and `dismiss_student` are never used [INFO] [stderr] --> rust_course/src/course_three/student.rs:30:12 [INFO] [stderr] | [INFO] [stderr] 14 | impl Student { [INFO] [stderr] | ------------ associated items in this implementation [INFO] [stderr] ... [INFO] [stderr] 30 | pub fn change_name(&mut self, name: String) { [INFO] [stderr] | ^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 34 | pub fn change_age(&mut self, age: u32) { [INFO] [stderr] | ^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 38 | pub fn change_class(&mut self, class: Class) { [INFO] [stderr] | ^^^^^^^^^^^^ [INFO] [stderr] ... [INFO] [stderr] 52 | pub fn dismiss_student(id: u32) { [INFO] [stderr] | ^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/main.rs:25:45 [INFO] [stderr] | [INFO] [stderr] 25 | unsafe { println!("all students: {:?}", STUDENTS) } [INFO] [stderr] | ^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] = note: `#[warn(static_mut_refs)]` on by default [INFO] [stderr] [INFO] [stderr] warning: creating a mutable reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/course_three/class.rs:23:13 [INFO] [stderr] | [INFO] [stderr] 23 | CLASSES.push(class.clone()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/course_three/class.rs:57:19 [INFO] [stderr] | [INFO] [stderr] 57 | match CLASSES.iter().position(|class| class.num == class_id) { [INFO] [stderr] | ^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] [INFO] [stderr] warning: creating a mutable reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/course_three/class.rs:60:21 [INFO] [stderr] | [INFO] [stderr] 60 | CLASSES.remove(index); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stderr] [INFO] [stderr] warning: creating a mutable reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/course_three/student.rs:25:13 [INFO] [stderr] | [INFO] [stderr] 25 | STUDENTS.push(student.clone()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/course_three/student.rs:44:32 [INFO] [stderr] | [INFO] [stderr] 44 | if let Some(stu) = STUDENTS.iter().find(|&s| s.num == id) { [INFO] [stderr] | ^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stderr] [INFO] [stderr] warning: creating a shared reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/course_three/student.rs:54:19 [INFO] [stderr] | [INFO] [stderr] 54 | match STUDENTS.iter().position(|stu| stu.num == id) { [INFO] [stderr] | ^^^^^^^^^^^^^^^ shared reference to mutable static [INFO] [stdout] [INFO] [stderr] | [INFO] [stdout] running 0 tests [INFO] [stderr] = note: for more information, see [INFO] [stdout] [INFO] [stderr] = note: shared references to mutable statics are dangerous; it's undefined behavior if the static is mutated or if a mutable reference is created for it while the shared reference lives [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stderr] [INFO] [stdout] [INFO] [stderr] warning: creating a mutable reference to mutable static is discouraged [INFO] [stderr] --> rust_course/src/course_three/student.rs:57:21 [INFO] [stderr] | [INFO] [stderr] 57 | STUDENTS.remove(index); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^ mutable reference to mutable static [INFO] [stderr] | [INFO] [stderr] = note: for more information, see [INFO] [stderr] = note: mutable references to mutable statics are dangerous; it's undefined behavior if any other pointer to the static is used or if any other reference is created for the static while the mutable reference lives [INFO] [stderr] [INFO] [stderr] warning: `hello_cargo` (bin "hello_cargo" test) generated 12 warnings (run `cargo fix --bin "hello_cargo" --tests` to apply 1 suggestion) [INFO] [stderr] warning: `rust_course` (bin "rust_course" test) generated 14 warnings [INFO] [stderr] Finished `test` profile [unoptimized + debuginfo] target(s) in 0.05s [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/guessing_game-6f8e920d82c6ed37) [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/hello_cargo-0476fbc99fb5e145) [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stderr] Running unittests src/lib.rs (/opt/rustwide/target/debug/deps/minigrep-8e989f77a65f9f41) [INFO] [stdout] [INFO] [stdout] running 2 tests [INFO] [stdout] test tests2::iterator_map ... ok [INFO] [stdout] test tests::one_result ... ok [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/minigrep-3345754a8f94e67b) [INFO] [stdout] [INFO] [stdout] test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/rust_async-c4e9c5d80b469c1f) [INFO] [stdout] [INFO] [stdout] running 1 test [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/rust_course-5118f49004402dd2) [INFO] [stdout] test timer_future::test ... ok [INFO] [stdout] [INFO] [stdout] test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.00s [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stderr] Running unittests src/lib.rs (/opt/rustwide/target/debug/deps/thread_pool-e4dbd6d61d3815fa) [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stderr] Running unittests src/main.rs (/opt/rustwide/target/debug/deps/thread_pool-145a58e3656af4dd) [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stderr] Doc-tests minigrep [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] [stderr] Doc-tests thread_pool [INFO] [stdout] [INFO] [stdout] running 0 tests [INFO] [stdout] [INFO] [stdout] test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s [INFO] [stdout] [INFO] running `Command { std: "docker" "inspect" "aae9668c115870edfeb82448d41be99198264e4678426e784234ee6c1f69e85b", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "aae9668c115870edfeb82448d41be99198264e4678426e784234ee6c1f69e85b", kill_on_drop: false }` [INFO] [stdout] aae9668c115870edfeb82448d41be99198264e4678426e784234ee6c1f69e85b