[INFO] cloning repository https://github.com/mxdzs0612/rust-by-practice [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/mxdzs0612/rust-by-practice" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxdzs0612%2Frust-by-practice", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxdzs0612%2Frust-by-practice'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] ab89d3528e8232391f1761d19227230912c60869 [INFO] testing mxdzs0612/rust-by-practice against try#c2e32f1c9652b13ed99608599c1e855462f421f3 for pr-146098-7 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fmxdzs0612%2Frust-by-practice" "/workspace/builds/worker-3-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-3-tc2/source'... [INFO] [stderr] done. [INFO] started tweaking git repo https://github.com/mxdzs0612/rust-by-practice [INFO] finished tweaking git repo https://github.com/mxdzs0612/rust-by-practice [INFO] tweaked toml for git repo https://github.com/mxdzs0612/rust-by-practice written to /workspace/builds/worker-3-tc2/source/Cargo.toml [INFO] validating manifest of git repo https://github.com/mxdzs0612/rust-by-practice on toolchain c2e32f1c9652b13ed99608599c1e855462f421f3 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+c2e32f1c9652b13ed99608599c1e855462f421f3" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] crate git repo https://github.com/mxdzs0612/rust-by-practice already has a lockfile, it will not be regenerated [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+c2e32f1c9652b13ed99608599c1e855462f421f3" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-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:4848fb76d95f26979359cc7e45710b1dbc8f3acb7aeedee7c460d7702230f228" "/opt/rustwide/cargo-home/bin/cargo" "+c2e32f1c9652b13ed99608599c1e855462f421f3" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 2af37218645ba89a5f28f01de73ff2eb98ffac60b73cdb8d91e92b9353e6008a [INFO] running `Command { std: "docker" "start" "-a" "2af37218645ba89a5f28f01de73ff2eb98ffac60b73cdb8d91e92b9353e6008a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "2af37218645ba89a5f28f01de73ff2eb98ffac60b73cdb8d91e92b9353e6008a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "2af37218645ba89a5f28f01de73ff2eb98ffac60b73cdb8d91e92b9353e6008a", kill_on_drop: false }` [INFO] [stdout] 2af37218645ba89a5f28f01de73ff2eb98ffac60b73cdb8d91e92b9353e6008a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-3-tc2/source:/opt/rustwide/workdir:ro,Z" "-v" "/var/lib/crater-agent-workspace/cargo-home:/opt/rustwide/cargo-home:ro,Z" "-v" "/var/lib/crater-agent-workspace/rustup-home:/opt/rustwide/rustup-home:ro,Z" "-e" "SOURCE_DIR=/opt/rustwide/workdir" "-e" "CARGO_TARGET_DIR=/opt/rustwide/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "RUSTDOCFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/rustwide/cargo-home" "-e" "RUSTUP_HOME=/opt/rustwide/rustup-home" "-w" "/opt/rustwide/workdir" "-m" "1610612736" "--user" "0:0" "--network" "none" "ghcr.io/rust-lang/crates-build-env/linux@sha256:4848fb76d95f26979359cc7e45710b1dbc8f3acb7aeedee7c460d7702230f228" "/opt/rustwide/cargo-home/bin/cargo" "+c2e32f1c9652b13ed99608599c1e855462f421f3" "build" "--frozen" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] 4fbccb0706556abb863e2e208b7d6e65f6c9c31d211f368f10d8e0395722e6e6 [INFO] running `Command { std: "docker" "start" "-a" "4fbccb0706556abb863e2e208b7d6e65f6c9c31d211f368f10d8e0395722e6e6", kill_on_drop: false }` [INFO] [stderr] Compiling rust_by_practice v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: function `complain` is never used [INFO] [stdout] --> src/front_of_house/serving.rs:8:4 [INFO] [stdout] | [INFO] [stdout] 8 | fn complain() {} [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/bin/8-1-8.rs:25:9 [INFO] [stdout] | [INFO] [stdout] 25 | Qux(u32), [INFO] [stdout] | --- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this variant [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field [INFO] [stdout] | [INFO] [stdout] 25 - Qux(u32), [INFO] [stdout] 25 + Qux(()), [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Bar` and `Baz` are never constructed [INFO] [stdout] --> src/bin/8-1-8.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 22 | enum Foo { [INFO] [stdout] | --- variants in this enum [INFO] [stdout] 23 | Bar, [INFO] [stdout] | ^^^ [INFO] [stdout] 24 | Baz, [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ele` [INFO] [stdout] --> src/bin/13-1-2.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | let ele = v[2]; [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ele` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ele` [INFO] [stdout] --> src/bin/13-1-2.rs:42:9 [INFO] [stdout] | [INFO] [stdout] 42 | let ele = v.get(2).unwrap(); [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_ele` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/bin/13-1-2.rs:45:9 [INFO] [stdout] | [INFO] [stdout] 45 | let v = production_rate_per_hour(2); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `ImportantExcerpt` is never constructed [INFO] [stdout] --> src/bin/17-3-2.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 19 | struct ImportantExcerpt<'a> { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `announce_and_return_part` is never used [INFO] [stdout] --> src/bin/17-3-2.rs:24:8 [INFO] [stdout] | [INFO] [stdout] 23 | impl<'a : 'b, 'b> ImportantExcerpt<'a> { [INFO] [stdout] | -------------------------------------- method in this implementation [INFO] [stdout] 24 | fn announce_and_return_part(&'a self, announcement: &'b str) -> &'b str { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `fly` is never used [INFO] [stdout] --> src/bin/10-4-2.rs:50:8 [INFO] [stdout] | [INFO] [stdout] 49 | impl Duck { [INFO] [stdout] | --------- method in this implementation [INFO] [stdout] 50 | fn fly(&self) { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `fly` is never used [INFO] [stdout] --> src/bin/10-4-2.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 55 | impl Swan { [INFO] [stdout] | --------- method in this implementation [INFO] [stdout] 56 | fn fly(&self) { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/bin/4-1-2.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | let v: u16 = 38_u8 as u16; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `CliError` is never used [INFO] [stdout] --> src/bin/12-2-3.rs:35:6 [INFO] [stdout] | [INFO] [stdout] 35 | enum CliError { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `open_and_parse_file` is never used [INFO] [stdout] --> src/bin/12-2-3.rs:52:4 [INFO] [stdout] | [INFO] [stdout] 52 | fn open_and_parse_file(file_name: &str) -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused label [INFO] [stdout] --> src/bin/7-11.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | 'inner2: loop { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_labels)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `integer` [INFO] [stdout] --> src/bin/10-1-3.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | let integer = Point { x: 5, y: 10 }; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_integer` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `float` [INFO] [stdout] --> src/bin/10-1-3.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let float = Point { x: 1.0, y: 4.0 }; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_float` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `x` and `y` are never read [INFO] [stdout] --> src/bin/10-1-3.rs:15:5 [INFO] [stdout] | [INFO] [stdout] 14 | struct Point{ [INFO] [stdout] | ----- fields in this struct [INFO] [stdout] 15 | x: T, [INFO] [stdout] | ^ [INFO] [stdout] 16 | y: T, [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::fmt::Result` [INFO] [stdout] --> src/bin/14-3-1.rs:8:5 [INFO] [stdout] | [INFO] [stdout] 8 | use std::fmt::Result; [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `std::io::Result as IoResult` [INFO] [stdout] --> src/bin/14-3-1.rs:9:5 [INFO] [stdout] | [INFO] [stdout] 9 | use std::io::Result as IoResult; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unnecessary parentheses around `if` condition [INFO] [stdout] --> src/bin/10-4-1.rs:115:8 [INFO] [stdout] | [INFO] [stdout] 115 | if (i == 1) { [INFO] [stdout] | ^ ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_parens)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] help: remove these parentheses [INFO] [stdout] | [INFO] [stdout] 115 - if (i == 1) { [INFO] [stdout] 115 + if i == 1 { [INFO] [stdout] | [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `fly` is never used [INFO] [stdout] --> src/bin/10-4-1.rs:76:8 [INFO] [stdout] | [INFO] [stdout] 75 | impl Swan { [INFO] [stdout] | --------- method in this implementation [INFO] [stdout] 76 | fn fly(&self) { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Person` is never constructed [INFO] [stdout] --> src/bin/6-4-5.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 18 | struct Person { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `build_person` is never used [INFO] [stdout] --> src/bin/6-4-5.rs:24:4 [INFO] [stdout] | [INFO] [stdout] 24 | fn build_person(name: String, age: u8) -> Person { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: irrefutable `if let` pattern [INFO] [stdout] --> src/bin/8-1-7.rs:25:8 [INFO] [stdout] | [INFO] [stdout] 25 | if let Foo::Bar(i) = a { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: this pattern will always match, so the `if let` is useless [INFO] [stdout] = help: consider replacing the `if let` with a `let` [INFO] [stdout] = note: `#[warn(irrefutable_let_patterns)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u2` [INFO] [stdout] --> src/bin/6-4-6.rs:41:9 [INFO] [stdout] | [INFO] [stdout] 41 | let u2 = set_email(u1); [INFO] [stdout] | ^^ help: if this is intentional, prefix it with an underscore: `_u2` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `active`, `username`, `email`, and `sign_in_count` are never read [INFO] [stdout] --> src/bin/6-4-6.rs:28:5 [INFO] [stdout] | [INFO] [stdout] 27 | struct User { [INFO] [stdout] | ---- fields in this struct [INFO] [stdout] 28 | active: bool, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] 29 | username: String, [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] 30 | email: String, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 31 | sign_in_count: u64, [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `call_on_ref_zero` is never used [INFO] [stdout] --> src/bin/17-3-4.rs:23:4 [INFO] [stdout] | [INFO] [stdout] 23 | fn call_on_ref_zero(f: F) where F: for<'a> Fn(&'a i32) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/bin/12-1-2.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | let v = 1000 as u8; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_v` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/bin/17-1-5.rs:39:9 [INFO] [stdout] | [INFO] [stdout] 39 | let y: &i32 = &_x; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/bin/5-2-7.rs:17:9 [INFO] [stdout] | [INFO] [stdout] 17 | let mut s = String::from("hello"); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_mut)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `TrafficLight` is never constructed [INFO] [stdout] --> src/bin/9-3.rs:18:8 [INFO] [stdout] | [INFO] [stdout] 18 | struct TrafficLight { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `show_state` and `change_state` are never used [INFO] [stdout] --> src/bin/9-3.rs:24:12 [INFO] [stdout] | [INFO] [stdout] 22 | impl TrafficLight { [INFO] [stdout] | ----------------- methods in this implementation [INFO] [stdout] 23 | // 使用 `Self` 填空 [INFO] [stdout] 24 | pub fn show_state(self: &Self) { [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 29 | pub fn change_state(&mut self) { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Quit`, `Write`, and `ChangeColor` are never constructed [INFO] [stdout] --> src/bin/6-6-3.rs:23:5 [INFO] [stdout] | [INFO] [stdout] 22 | enum Message { [INFO] [stdout] | ------- variants in this enum [INFO] [stdout] 23 | Quit, [INFO] [stdout] | ^^^^ [INFO] [stdout] 24 | Move { x: i32, y: i32 }, [INFO] [stdout] 25 | Write(String), [INFO] [stdout] | ^^^^^ [INFO] [stdout] 26 | ChangeColor(i32, i32, i32), [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `manager` is never read [INFO] [stdout] --> src/bin/17-3-6.rs:69:5 [INFO] [stdout] | [INFO] [stdout] 68 | struct Interface<'b, 'a: 'b> { [INFO] [stdout] | --------- field in this struct [INFO] [stdout] 69 | manager: &'b mut Manager<'a> [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `y` is assigned to, but never used [INFO] [stdout] --> src/bin/4-1-1.rs:19:9 [INFO] [stdout] | [INFO] [stdout] 19 | let mut y = 5; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_y` instead [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `z` [INFO] [stdout] --> src/bin/4-1-1.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | let z = 10; // 这里 z 的类型是? [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `y` is never read [INFO] [stdout] --> src/bin/4-1-1.rs:21:5 [INFO] [stdout] | [INFO] [stdout] 21 | y = x; [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `longest` is never used [INFO] [stdout] --> src/bin/17-1-3.rs:56:4 [INFO] [stdout] | [INFO] [stdout] 56 | fn longest<'a>(x: &'a str, y: &'a str) -> &'a str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function `new` is never used [INFO] [stdout] --> src/bin/10-3-8.rs:45:8 [INFO] [stdout] | [INFO] [stdout] 44 | impl Pair { [INFO] [stdout] | --------------- associated function in this implementation [INFO] [stdout] 45 | fn new(x: T, y: T) -> Self { [INFO] [stdout] | ^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/bin/5-2-9.rs:23:18 [INFO] [stdout] | [INFO] [stdout] 23 | fn borrow_object(s: &String) {} [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/7-8.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | for i in 0..=100 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/bin/17-1-10.rs:48:32 [INFO] [stdout] | [INFO] [stdout] 48 | fn longest<'a, 'b>(x: &'a str, y: &'b str) -> &'a str { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `nput` is never used [INFO] [stdout] --> src/bin/17-1-10.rs:42:4 [INFO] [stdout] | [INFO] [stdout] 42 | fn nput<>(x: &i32) { [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `pass` is never used [INFO] [stdout] --> src/bin/17-1-10.rs:46:4 [INFO] [stdout] | [INFO] [stdout] 46 | fn pass<>(x: &i32) -> &i32 { x } [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `longest` is never used [INFO] [stdout] --> src/bin/17-1-10.rs:48:4 [INFO] [stdout] | [INFO] [stdout] 48 | fn longest<'a, 'b>(x: &'a str, y: &'b str) -> &'a str { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Owner` is never constructed [INFO] [stdout] --> src/bin/17-1-10.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | struct Owner(i32); [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: methods `add_one` and `print` are never used [INFO] [stdout] --> src/bin/17-1-10.rs:55:8 [INFO] [stdout] | [INFO] [stdout] 54 | impl Owner { [INFO] [stdout] | ---------- methods in this implementation [INFO] [stdout] 55 | fn add_one(&mut self) { self.0 += 1; } [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] 56 | fn print(&self) { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Person` is never constructed [INFO] [stdout] --> src/bin/17-1-10.rs:61:8 [INFO] [stdout] | [INFO] [stdout] 61 | struct Person<'a> { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Either` is never used [INFO] [stdout] --> src/bin/17-1-10.rs:66:6 [INFO] [stdout] | [INFO] [stdout] 66 | enum Either<'a> { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `thing` [INFO] [stdout] --> src/bin/19-9.rs:11:11 [INFO] [stdout] | [INFO] [stdout] 11 | fn foobar(thing: &dyn Display) {} [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_thing` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `thing` [INFO] [stdout] --> src/bin/19-9.rs:13:12 [INFO] [stdout] | [INFO] [stdout] 13 | fn foobar2(thing: Box) {} [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_thing` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `foobar` is never used [INFO] [stdout] --> src/bin/19-9.rs:11:4 [INFO] [stdout] | [INFO] [stdout] 11 | fn foobar(thing: &dyn Display) {} [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `foobar2` is never used [INFO] [stdout] --> src/bin/19-9.rs:13:4 [INFO] [stdout] | [INFO] [stdout] 13 | fn foobar2(thing: Box) {} [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `i` [INFO] [stdout] --> src/bin/7-7.rs:20:9 [INFO] [stdout] | [INFO] [stdout] 20 | for i in 0..=100 { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_i` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/bin/18-1-4.rs:21:9 [INFO] [stdout] | [INFO] [stdout] 21 | let s = example_closure(String::from("hello")); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `n` [INFO] [stdout] --> src/bin/18-1-4.rs:24:9 [INFO] [stdout] | [INFO] [stdout] 24 | let n = example_closure("5".to_string()); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_n` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variants `Red` and `Green` are never constructed [INFO] [stdout] --> src/bin/9-6.rs:27:5 [INFO] [stdout] | [INFO] [stdout] 26 | enum TrafficLightColor { [INFO] [stdout] | ----------------- variants in this enum [INFO] [stdout] 27 | Red, [INFO] [stdout] | ^^^ [INFO] [stdout] 28 | Yellow, [INFO] [stdout] 29 | Green, [INFO] [stdout] | ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `TrafficLightColor` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `invalid_output` is never used [INFO] [stdout] --> src/bin/17-1-4.rs:11:4 [INFO] [stdout] | [INFO] [stdout] 11 | fn invalid_output() -> String { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] error[E0499]: cannot borrow `s` as mutable more than once at a time [INFO] [stdout] --> src/bin/5-2-11.rs:18:14 [INFO] [stdout] | [INFO] [stdout] 17 | let r1 = &mut s; [INFO] [stdout] | ------ first mutable borrow occurs here [INFO] [stdout] 18 | let r2 = &mut s; [INFO] [stdout] | ^^^^^^ second mutable borrow occurs here [INFO] [stdout] ... [INFO] [stdout] 22 | println!("{} {}", r1, r2); [INFO] [stdout] | -- first borrow later used here [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] For more information about this error, try `rustc --explain E0499`. [INFO] [stdout] [INFO] [stderr] error: could not compile `rust_by_practice` (bin "5-2-11") due to 1 previous error [INFO] [stderr] warning: build failed, waiting for other jobs to finish... [INFO] [stdout] warning: unused import: `self` [INFO] [stdout] --> src/bin/10-3-3.rs:20:16 [INFO] [stdout] | [INFO] [stdout] 20 | use std::ops::{self, Mul}; [INFO] [stdout] | ^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `x` [INFO] [stdout] --> src/bin/4-1-7.rs:12:9 [INFO] [stdout] | [INFO] [stdout] 12 | let x = 1_000.000_1; // f64 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_x` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/bin/4-1-7.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | let y: f32 = 0.12; // f32 [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/bin/4-1-7.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | let z = 0.01_f64; // f64 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `0` is never read [INFO] [stdout] --> src/bin/16-2-1.rs:34:18 [INFO] [stdout] | [INFO] [stdout] 34 | struct Structure(i32); [INFO] [stdout] | --------- ^^^ [INFO] [stdout] | | [INFO] [stdout] | field in this struct [INFO] [stdout] | [INFO] [stdout] = help: consider removing this field [INFO] [stdout] = note: `Structure` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: fields `width` and `height` are never read [INFO] [stdout] --> src/bin/6-4-7.rs:26:5 [INFO] [stdout] | [INFO] [stdout] 25 | struct Rectangle { [INFO] [stdout] | --------- fields in this struct [INFO] [stdout] 26 | width: u32, [INFO] [stdout] | ^^^^^ [INFO] [stdout] 27 | height: u32, [INFO] [stdout] | ^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `Rectangle` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis [INFO] [stdout] = note: `#[warn(dead_code)]` (part of `#[warn(unused)]`) on by default [INFO] [stdout] [INFO] [stdout] [INFO] running `Command { std: "docker" "inspect" "4fbccb0706556abb863e2e208b7d6e65f6c9c31d211f368f10d8e0395722e6e6", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4fbccb0706556abb863e2e208b7d6e65f6c9c31d211f368f10d8e0395722e6e6", kill_on_drop: false }` [INFO] [stdout] 4fbccb0706556abb863e2e208b7d6e65f6c9c31d211f368f10d8e0395722e6e6