[INFO] cloning repository https://github.com/llorz-o/rust-learn [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/llorz-o/rust-learn" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fllorz-o%2Frust-learn", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fllorz-o%2Frust-learn'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 1aa1054ecb956f1c75a8ea58a9a24d7dfc62b13a [INFO] checking llorz-o/rust-learn against beta for pr-78714 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fllorz-o%2Frust-learn" "/workspace/builds/worker-5/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/llorz-o/rust-learn on toolchain beta [INFO] running `Command { std: "/workspace/cargo-home/bin/cargo" "+beta" "read-manifest" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/llorz-o/rust-learn [INFO] finished tweaking git repo https://github.com/llorz-o/rust-learn [INFO] tweaked toml for git repo https://github.com/llorz-o/rust-learn written to /workspace/builds/worker-5/source/Cargo.toml [INFO] crate git repo https://github.com/llorz-o/rust-learn already has a lockfile, it will not be regenerated [INFO] running `Command { std: "/workspace/cargo-home/bin/cargo" "+beta" "fetch" "--locked" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5/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" "rustops/crates-build-env@sha256:6eabd152ff4036248d66efda456a36cb33d24b7291b33f25f75140726c88da35" "/opt/rustwide/cargo-home/bin/cargo" "+beta" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] bb875fdc918d2ce6965dd5086f098f6b244f655998d220bd3920044a658f8a7c [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] running `Command { std: "docker" "start" "-a" "bb875fdc918d2ce6965dd5086f098f6b244f655998d220bd3920044a658f8a7c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "bb875fdc918d2ce6965dd5086f098f6b244f655998d220bd3920044a658f8a7c", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "bb875fdc918d2ce6965dd5086f098f6b244f655998d220bd3920044a658f8a7c", kill_on_drop: false }` [INFO] [stdout] bb875fdc918d2ce6965dd5086f098f6b244f655998d220bd3920044a658f8a7c [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "rustops/crates-build-env@sha256:6eabd152ff4036248d66efda456a36cb33d24b7291b33f25f75140726c88da35" "/opt/rustwide/cargo-home/bin/cargo" "+beta" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 1dacb88a7142a6a26dfabb075a0c9f5ba1fed8780ac57e24041df3c6c8fffe8e [INFO] [stderr] WARNING: Your kernel does not support swap limit capabilities or the cgroup is not mounted. Memory limited without swap. [INFO] running `Command { std: "docker" "start" "-a" "1dacb88a7142a6a26dfabb075a0c9f5ba1fed8780ac57e24041df3c6c8fffe8e", kill_on_drop: false }` [INFO] [stderr] Compiling libc v0.2.77 [INFO] [stderr] Checking getrandom v0.1.15 [INFO] [stderr] Checking rand_core v0.5.1 [INFO] [stderr] Checking rand_chacha v0.2.2 [INFO] [stderr] Checking rand v0.7.3 [INFO] [stderr] Checking rust-learn v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] error[E0432]: unresolved import `add_two` [INFO] [stdout] --> tests/mode12_test.rs:1:5 [INFO] [stdout] | [INFO] [stdout] 1 | use add_two; [INFO] [stdout] | ^^^^^^^ no external crate `add_two` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error: aborting due to previous error [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0432`. [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::io::copy` [INFO] [stdout] --> src/demo/demo1.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::io::copy; // 也可已引入方法 [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::*` [INFO] [stdout] --> src/demo/demo1.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use std::collections::*; // 引入模块下所有公共项 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/demo/demo3_branches.rs:28:17 [INFO] [stdout] | [INFO] [stdout] 28 | for elem in (1..9) {} [INFO] [stdout] | ^^^^^^ help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::exercise::*` [INFO] [stdout] --> src/main.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::exercise::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: could not compile `rust-learn` [INFO] [stderr] [INFO] [stderr] To learn more, run the command again with --verbose. [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stdout] warning: unused import: `std::io::copy` [INFO] [stdout] --> src/demo/demo1.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | use std::io::copy; // 也可已引入方法 [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::collections::*` [INFO] [stdout] --> src/demo/demo1.rs:7:5 [INFO] [stdout] | [INFO] [stdout] 7 | use std::collections::*; // 引入模块下所有公共项 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `for` iterator expression [INFO] [stdout] --> src/demo/demo3_branches.rs:28:17 [INFO] [stdout] | [INFO] [stdout] 28 | for elem in (1..9) {} [INFO] [stdout] | ^^^^^^ help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `crate::exercise::*` [INFO] [stdout] --> src/main.rs:5:5 [INFO] [stdout] | [INFO] [stdout] 5 | use crate::exercise::*; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/demo/demo10_err.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | let f = match 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] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:67:11 [INFO] [stdout] | [INFO] [stdout] 67 | fn notify(item: impl Summary) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:69:24 [INFO] [stdout] | [INFO] [stdout] 69 | fn notify2(item: T, item2: T) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/demo/demo11_trait.rs:69:33 [INFO] [stdout] | [INFO] [stdout] 69 | fn notify2(item: T, item2: T) {} [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_item2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | fn notify3(item: impl Summary + T2) -> impl Summary { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:78:36 [INFO] [stdout] | [INFO] [stdout] 78 | fn notify4(item: T, item2: U) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/demo/demo11_trait.rs:78:45 [INFO] [stdout] | [INFO] [stdout] 78 | fn notify4(item: T, item2: U) {} [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_item2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:80:18 [INFO] [stdout] | [INFO] [stdout] 80 | fn notity5(item: T, item2: U) [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/demo/demo11_trait.rs:80:27 [INFO] [stdout] | [INFO] [stdout] 80 | fn notity5(item: T, item2: U) [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_item2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> src/demo/demo11_trait.rs:147:30 [INFO] [stdout] | [INFO] [stdout] 147 | fn t<'a, 'b>(a: &'a str, b: &'b str) -> &'a str { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/demo/demo11_trait.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | fn new(x: T, y: T) {} [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/demo/demo11_trait.rs:94:18 [INFO] [stdout] | [INFO] [stdout] 94 | fn new(x: T, y: T) {} [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/demo/demo2_veriable.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | let f: f64 = 2.0; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `bl` [INFO] [stdout] --> src/demo/demo2_veriable.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | let bl: bool = false; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_bl` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `z` [INFO] [stdout] --> src/demo/demo2_veriable.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | let z: char = 'z'; // 字符类型用单引号表示,大小为4个字节,字符不是字符串 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/demo/demo2_veriable.rs:50:10 [INFO] [stdout] | [INFO] [stdout] 50 | let (x, y, z) = tup; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/demo/demo2_veriable.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | let (x, y, z) = tup; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `z` [INFO] [stdout] --> src/demo/demo2_veriable.rs:50:16 [INFO] [stdout] | [INFO] [stdout] 50 | let (x, y, z) = tup; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/demo/demo2_veriable.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let x = tup.0; // 第零位 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arr` [INFO] [stdout] --> src/demo/demo2_veriable.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | let arr = [1, 2, 3, 4, 5]; [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_arr` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arr2` [INFO] [stdout] --> src/demo/demo2_veriable.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | let arr2: [i32; 4] = [1, 2, 3, 4]; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_arr2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arr3` [INFO] [stdout] --> src/demo/demo2_veriable.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | let arr3 = [1; 3]; // 指定初始值的数组 = [1,1,1] [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_arr3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `w` [INFO] [stdout] --> src/demo/demo2_veriable.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | let w = { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_w` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `elem` [INFO] [stdout] --> src/demo/demo3_branches.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | for elem in (1..9) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_elem` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s4` [INFO] [stdout] --> src/demo/demo4_ownership.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | let s4 = takes_ownership(s3); // 引用类型将所有权移交给函数的参数,函数执行结束时 drop 了该内存块 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s3` [INFO] [stdout] --> src/demo/demo4_ownership.rs:36:9 [INFO] [stdout] | [INFO] [stdout] 36 | let s3 = &mut s2; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s4` [INFO] [stdout] --> src/demo/demo4_ownership.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | let s4 = &mut s2; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s5` [INFO] [stdout] --> src/demo/demo4_ownership.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | let s5 = &s2; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s5` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/demo/demo4_ownership.rs:48:9 [INFO] [stdout] | [INFO] [stdout] 48 | let slice = &s[0..5]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice2` [INFO] [stdout] --> src/demo/demo4_ownership.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | let slice2 = &s[0..]; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_slice2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice3` [INFO] [stdout] --> src/demo/demo4_ownership.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let slice3 = &s[..s.len()]; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_slice3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice4` [INFO] [stdout] --> src/demo/demo4_ownership.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let slice4 = &s[..]; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_slice4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `user3` [INFO] [stdout] --> src/demo/demo5_struct.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let user3 = User { age: 15, ..user2 }; // 可从user2中获取未设字段 [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_user3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `r` [INFO] [stdout] --> src/demo/demo5_struct.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | let r = black.0; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_r` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `rectangle2` [INFO] [stdout] --> src/demo/demo5_struct.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | let rectangle2 = Rectangle::factory(12, 50); [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_rectangle2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v6` [INFO] [stdout] --> src/demo/demo6_enum.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | let v6 = IpAddrKind::V6(String::from("127.0.0.1")); [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_v6` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `name` is never read [INFO] [stdout] --> src/demo/demo6_enum.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | let mut name: Option = Some(String::from("nihao")); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_assignments)]` on by default [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/demo/demo7_vector.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | let v: Vec = Vec::new(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v1` [INFO] [stdout] --> src/demo/demo7_vector.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let v1 = vec![1, 2, 3]; // vector 中仅允许一种类型的数据,具有类型推断 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_v1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `third` [INFO] [stdout] --> src/demo/demo7_vector.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let third: &i32 = &v2[2]; // 使用下标取值有可能导致 panic!,可使用 get(i) 取值 [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_third` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v3` [INFO] [stdout] --> src/demo/demo7_vector.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | let v3 = vec![Test::Age(1), Test::Name(String::from("name"))]; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_v3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `s` is assigned to, but never used [INFO] [stdout] --> src/demo/demo8_string.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut s = String::new(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_s` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `s` is never read [INFO] [stdout] --> src/demo/demo8_string.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | s = str1.to_string(); // to_string 方法,它能用于任何实现了 Display trait 的类型 [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> src/demo/demo8_string.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | let len = String::from("Hello").len(); // => 5 返回 Vec 的长度 [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> src/demo/demo8_string.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let len = String::from("Здравствуйте").len(); // => 24 [224,....23] [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/demo/demo8_string.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | let s = &str3[0..4]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/demo/demo2_veriable.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let mut a: u8 = 255; // u8 类型最高值为255 [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: unused variable: `f` [INFO] [stdout] --> src/demo/demo10_err.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | let f = match 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] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:67:11 [INFO] [stdout] | [INFO] [stdout] 67 | fn notify(item: impl Summary) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:69:24 [INFO] [stdout] | [INFO] [stdout] 69 | fn notify2(item: T, item2: T) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/demo/demo11_trait.rs:69:33 [INFO] [stdout] | [INFO] [stdout] 69 | fn notify2(item: T, item2: T) {} [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_item2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:71:12 [INFO] [stdout] | [INFO] [stdout] 71 | fn notify3(item: impl Summary + T2) -> impl Summary { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:78:36 [INFO] [stdout] | [INFO] [stdout] 78 | fn notify4(item: T, item2: U) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/demo/demo11_trait.rs:78:45 [INFO] [stdout] | [INFO] [stdout] 78 | fn notify4(item: T, item2: U) {} [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_item2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/demo/demo11_trait.rs:80:18 [INFO] [stdout] | [INFO] [stdout] 80 | fn notity5(item: T, item2: U) [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/demo/demo11_trait.rs:80:27 [INFO] [stdout] | [INFO] [stdout] 80 | fn notity5(item: T, item2: U) [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_item2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> src/demo/demo11_trait.rs:147:30 [INFO] [stdout] | [INFO] [stdout] 147 | fn t<'a, 'b>(a: &'a str, b: &'b str) -> &'a str { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/demo/demo11_trait.rs:94:12 [INFO] [stdout] | [INFO] [stdout] 94 | fn new(x: T, y: T) {} [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/demo/demo11_trait.rs:94:18 [INFO] [stdout] | [INFO] [stdout] 94 | fn new(x: T, y: T) {} [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `f` [INFO] [stdout] --> src/demo/demo2_veriable.rs:40:9 [INFO] [stdout] | [INFO] [stdout] 40 | let f: f64 = 2.0; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_f` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `bl` [INFO] [stdout] --> src/demo/demo2_veriable.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | let bl: bool = false; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_bl` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `z` [INFO] [stdout] --> src/demo/demo2_veriable.rs:44:9 [INFO] [stdout] | [INFO] [stdout] 44 | let z: char = 'z'; // 字符类型用单引号表示,大小为4个字节,字符不是字符串 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/demo/demo2_veriable.rs:50:10 [INFO] [stdout] | [INFO] [stdout] 50 | let (x, y, z) = tup; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/demo/demo2_veriable.rs:50:13 [INFO] [stdout] | [INFO] [stdout] 50 | let (x, y, z) = tup; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `z` [INFO] [stdout] --> src/demo/demo2_veriable.rs:50:16 [INFO] [stdout] | [INFO] [stdout] 50 | let (x, y, z) = tup; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/demo/demo2_veriable.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let x = tup.0; // 第零位 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arr` [INFO] [stdout] --> src/demo/demo2_veriable.rs:55:9 [INFO] [stdout] | [INFO] [stdout] 55 | let arr = [1, 2, 3, 4, 5]; [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_arr` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arr2` [INFO] [stdout] --> src/demo/demo2_veriable.rs:56:9 [INFO] [stdout] | [INFO] [stdout] 56 | let arr2: [i32; 4] = [1, 2, 3, 4]; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_arr2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arr3` [INFO] [stdout] --> src/demo/demo2_veriable.rs:57:9 [INFO] [stdout] | [INFO] [stdout] 57 | let arr3 = [1; 3]; // 指定初始值的数组 = [1,1,1] [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_arr3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `w` [INFO] [stdout] --> src/demo/demo2_veriable.rs:64:9 [INFO] [stdout] | [INFO] [stdout] 64 | let w = { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_w` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `elem` [INFO] [stdout] --> src/demo/demo3_branches.rs:28:9 [INFO] [stdout] | [INFO] [stdout] 28 | for elem in (1..9) {} [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_elem` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s4` [INFO] [stdout] --> src/demo/demo4_ownership.rs:25:13 [INFO] [stdout] | [INFO] [stdout] 25 | let s4 = takes_ownership(s3); // 引用类型将所有权移交给函数的参数,函数执行结束时 drop 了该内存块 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s3` [INFO] [stdout] --> src/demo/demo4_ownership.rs:36:9 [INFO] [stdout] | [INFO] [stdout] 36 | let s3 = &mut s2; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s4` [INFO] [stdout] --> src/demo/demo4_ownership.rs:37:9 [INFO] [stdout] | [INFO] [stdout] 37 | let s4 = &mut s2; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s5` [INFO] [stdout] --> src/demo/demo4_ownership.rs:38:9 [INFO] [stdout] | [INFO] [stdout] 38 | let s5 = &s2; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_s5` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/demo/demo4_ownership.rs:48:9 [INFO] [stdout] | [INFO] [stdout] 48 | let slice = &s[0..5]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice2` [INFO] [stdout] --> src/demo/demo4_ownership.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | let slice2 = &s[0..]; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_slice2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice3` [INFO] [stdout] --> src/demo/demo4_ownership.rs:50:9 [INFO] [stdout] | [INFO] [stdout] 50 | let slice3 = &s[..s.len()]; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_slice3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice4` [INFO] [stdout] --> src/demo/demo4_ownership.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let slice4 = &s[..]; [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_slice4` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `user3` [INFO] [stdout] --> src/demo/demo5_struct.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let user3 = User { age: 15, ..user2 }; // 可从user2中获取未设字段 [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_user3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `r` [INFO] [stdout] --> src/demo/demo5_struct.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | let r = black.0; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_r` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `rectangle2` [INFO] [stdout] --> src/demo/demo5_struct.rs:34:9 [INFO] [stdout] | [INFO] [stdout] 34 | let rectangle2 = Rectangle::factory(12, 50); [INFO] [stdout] | ^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_rectangle2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v6` [INFO] [stdout] --> src/demo/demo6_enum.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | let v6 = IpAddrKind::V6(String::from("127.0.0.1")); [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_v6` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `name` is never read [INFO] [stdout] --> src/demo/demo6_enum.rs:31:9 [INFO] [stdout] | [INFO] [stdout] 31 | let mut name: Option = Some(String::from("nihao")); [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_assignments)]` on by default [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/demo/demo7_vector.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | let v: Vec = Vec::new(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v1` [INFO] [stdout] --> src/demo/demo7_vector.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | let v1 = vec![1, 2, 3]; // vector 中仅允许一种类型的数据,具有类型推断 [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_v1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `third` [INFO] [stdout] --> src/demo/demo7_vector.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let third: &i32 = &v2[2]; // 使用下标取值有可能导致 panic!,可使用 get(i) 取值 [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_third` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v3` [INFO] [stdout] --> src/demo/demo7_vector.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | let v3 = vec![Test::Age(1), Test::Name(String::from("name"))]; [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_v3` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `s` is assigned to, but never used [INFO] [stdout] --> src/demo/demo8_string.rs:2:9 [INFO] [stdout] | [INFO] [stdout] 2 | let mut s = String::new(); [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_s` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `s` is never read [INFO] [stdout] --> src/demo/demo8_string.rs:4:5 [INFO] [stdout] | [INFO] [stdout] 4 | s = str1.to_string(); // to_string 方法,它能用于任何实现了 Display trait 的类型 [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> src/demo/demo8_string.rs:15:9 [INFO] [stdout] | [INFO] [stdout] 15 | let len = String::from("Hello").len(); // => 5 返回 Vec 的长度 [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `len` [INFO] [stdout] --> src/demo/demo8_string.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let len = String::from("Здравствуйте").len(); // => 24 [224,....23] [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_len` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/demo/demo8_string.rs:22:9 [INFO] [stdout] | [INFO] [stdout] 22 | let s = &str3[0..4]; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Point1` [INFO] [stdout] --> src/demo/demo11_trait.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | struct Point1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Point2` [INFO] [stdout] --> src/demo/demo11_trait.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | struct Point2 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `x` [INFO] [stdout] --> src/demo/demo11_trait.rs:14:8 [INFO] [stdout] | [INFO] [stdout] 14 | fn x(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `mixup` [INFO] [stdout] --> src/demo/demo11_trait.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | fn mixup(self, other: Point2) -> Point2 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum is never used: `Result` [INFO] [stdout] --> src/demo/demo11_trait.rs:25:6 [INFO] [stdout] | [INFO] [stdout] 25 | enum Result { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify` [INFO] [stdout] --> src/demo/demo11_trait.rs:67:4 [INFO] [stdout] | [INFO] [stdout] 67 | fn notify(item: impl Summary) {} [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify2` [INFO] [stdout] --> src/demo/demo11_trait.rs:69:4 [INFO] [stdout] | [INFO] [stdout] 69 | fn notify2(item: T, item2: T) {} [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify3` [INFO] [stdout] --> src/demo/demo11_trait.rs:71:4 [INFO] [stdout] | [INFO] [stdout] 71 | fn notify3(item: impl Summary + T2) -> impl Summary { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify4` [INFO] [stdout] --> src/demo/demo11_trait.rs:78:4 [INFO] [stdout] | [INFO] [stdout] 78 | fn notify4(item: T, item2: U) {} [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notity5` [INFO] [stdout] --> src/demo/demo11_trait.rs:80:4 [INFO] [stdout] | [INFO] [stdout] 80 | fn notity5(item: T, item2: U) [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `x` [INFO] [stdout] --> src/demo/demo11_trait.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | x: T, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `y` [INFO] [stdout] --> src/demo/demo11_trait.rs:89:5 [INFO] [stdout] | [INFO] [stdout] 89 | y: T, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `st` [INFO] [stdout] --> src/demo/demo11_trait.rs:98:8 [INFO] [stdout] | [INFO] [stdout] 98 | fn st() {} [INFO] [stdout] | ^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `privatefn` [INFO] [stdout] --> src/demo/demo12_tests.rs:5:4 [INFO] [stdout] | [INFO] [stdout] 5 | fn privatefn() -> i32 { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `another_function` [INFO] [stdout] --> src/demo/demo2_veriable.rs:76:4 [INFO] [stdout] | [INFO] [stdout] 76 | fn another_function(x: i32, y: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `dangling` [INFO] [stdout] --> src/demo/demo4_ownership.rs:70:4 [INFO] [stdout] | [INFO] [stdout] 70 | fn dangling() -> String { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `username` [INFO] [stdout] --> src/demo/demo5_struct.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | username: String, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `email` [INFO] [stdout] --> src/demo/demo5_struct.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | email: String, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `active` [INFO] [stdout] --> src/demo/demo5_struct.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | active: bool, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Ipv4` [INFO] [stdout] --> src/demo/demo6_enum.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | Ipv4(Ipv4Addr), [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Demo` [INFO] [stdout] --> src/demo/demo6_enum.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | Demo(Demo), // 任意类型的值甚至枚举 [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/demo/demo2_veriable.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let mut a: u8 = 255; // u8 类型最高值为255 [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: 72 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Point1` [INFO] [stdout] --> src/demo/demo11_trait.rs:3:8 [INFO] [stdout] | [INFO] [stdout] 3 | struct Point1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Point2` [INFO] [stdout] --> src/demo/demo11_trait.rs:8:8 [INFO] [stdout] | [INFO] [stdout] 8 | struct Point2 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `x` [INFO] [stdout] --> src/demo/demo11_trait.rs:14:8 [INFO] [stdout] | [INFO] [stdout] 14 | fn x(&self) -> &T { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `mixup` [INFO] [stdout] --> src/demo/demo11_trait.rs:17:8 [INFO] [stdout] | [INFO] [stdout] 17 | fn mixup(self, other: Point2) -> Point2 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum is never used: `Result` [INFO] [stdout] --> src/demo/demo11_trait.rs:25:6 [INFO] [stdout] | [INFO] [stdout] 25 | enum Result { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify` [INFO] [stdout] --> src/demo/demo11_trait.rs:67:4 [INFO] [stdout] | [INFO] [stdout] 67 | fn notify(item: impl Summary) {} [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify2` [INFO] [stdout] --> src/demo/demo11_trait.rs:69:4 [INFO] [stdout] | [INFO] [stdout] 69 | fn notify2(item: T, item2: T) {} [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify3` [INFO] [stdout] --> src/demo/demo11_trait.rs:71:4 [INFO] [stdout] | [INFO] [stdout] 71 | fn notify3(item: impl Summary + T2) -> impl Summary { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify4` [INFO] [stdout] --> src/demo/demo11_trait.rs:78:4 [INFO] [stdout] | [INFO] [stdout] 78 | fn notify4(item: T, item2: U) {} [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notity5` [INFO] [stdout] --> src/demo/demo11_trait.rs:80:4 [INFO] [stdout] | [INFO] [stdout] 80 | fn notity5(item: T, item2: U) [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `x` [INFO] [stdout] --> src/demo/demo11_trait.rs:88:5 [INFO] [stdout] | [INFO] [stdout] 88 | x: T, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `y` [INFO] [stdout] --> src/demo/demo11_trait.rs:89:5 [INFO] [stdout] | [INFO] [stdout] 89 | y: T, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `st` [INFO] [stdout] --> src/demo/demo11_trait.rs:98:8 [INFO] [stdout] | [INFO] [stdout] 98 | fn st() {} [INFO] [stdout] | ^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `another_function` [INFO] [stdout] --> src/demo/demo2_veriable.rs:76:4 [INFO] [stdout] | [INFO] [stdout] 76 | fn another_function(x: i32, y: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `dangling` [INFO] [stdout] --> src/demo/demo4_ownership.rs:70:4 [INFO] [stdout] | [INFO] [stdout] 70 | fn dangling() -> String { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `username` [INFO] [stdout] --> src/demo/demo5_struct.rs:71:5 [INFO] [stdout] | [INFO] [stdout] 71 | username: String, [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `email` [INFO] [stdout] --> src/demo/demo5_struct.rs:72:5 [INFO] [stdout] | [INFO] [stdout] 72 | email: String, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `active` [INFO] [stdout] --> src/demo/demo5_struct.rs:74:5 [INFO] [stdout] | [INFO] [stdout] 74 | active: bool, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Ipv4` [INFO] [stdout] --> src/demo/demo6_enum.rs:11:5 [INFO] [stdout] | [INFO] [stdout] 11 | Ipv4(Ipv4Addr), [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Demo` [INFO] [stdout] --> src/demo/demo6_enum.rs:12:5 [INFO] [stdout] | [INFO] [stdout] 12 | Demo(Demo), // 任意类型的值甚至枚举 [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 71 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] error: build failed [INFO] running `Command { std: "docker" "inspect" "1dacb88a7142a6a26dfabb075a0c9f5ba1fed8780ac57e24041df3c6c8fffe8e", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "1dacb88a7142a6a26dfabb075a0c9f5ba1fed8780ac57e24041df3c6c8fffe8e", kill_on_drop: false }` [INFO] [stdout] 1dacb88a7142a6a26dfabb075a0c9f5ba1fed8780ac57e24041df3c6c8fffe8e