[INFO] cloning repository https://github.com/breakinferno/learn-rust-demo [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/breakinferno/learn-rust-demo" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbreakinferno%2Flearn-rust-demo", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbreakinferno%2Flearn-rust-demo'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] 120c62dcfed0a2c273a142b22b81158cadc8377f [INFO] checking breakinferno/learn-rust-demo against master#00bfd6b2734d9c28a147bf237490995731781fdd for pr-117984 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbreakinferno%2Flearn-rust-demo" "/workspace/builds/worker-5-tc1/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc1/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/breakinferno/learn-rust-demo on toolchain 00bfd6b2734d9c28a147bf237490995731781fdd [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+00bfd6b2734d9c28a147bf237490995731781fdd" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/breakinferno/learn-rust-demo [INFO] finished tweaking git repo https://github.com/breakinferno/learn-rust-demo [INFO] tweaked toml for git repo https://github.com/breakinferno/learn-rust-demo written to /workspace/builds/worker-5-tc1/source/Cargo.toml [INFO] crate git repo https://github.com/breakinferno/learn-rust-demo 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" "+00bfd6b2734d9c28a147bf237490995731781fdd" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] [stderr] Blocking waiting for file lock on package cache [ERROR] error running command: no output for 300 seconds [ERROR] this task or one of its parent failed! [ERROR] no output for 300 seconds [ERROR] note: run with `RUST_BACKTRACE=1` to display a backtrace. [INFO] checking breakinferno/learn-rust-demo against try#aa7c6ba69acce8b10a275eabfe6157ea72c8b599 for pr-117984 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Fbreakinferno%2Flearn-rust-demo" "/workspace/builds/worker-5-tc2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-5-tc2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/breakinferno/learn-rust-demo on toolchain aa7c6ba69acce8b10a275eabfe6157ea72c8b599 [INFO] running `Command { std: CARGO_HOME="/workspace/cargo-home" RUSTUP_HOME="/workspace/rustup-home" "/workspace/cargo-home/bin/cargo" "+aa7c6ba69acce8b10a275eabfe6157ea72c8b599" "metadata" "--manifest-path" "Cargo.toml" "--no-deps", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/breakinferno/learn-rust-demo [INFO] finished tweaking git repo https://github.com/breakinferno/learn-rust-demo [INFO] tweaked toml for git repo https://github.com/breakinferno/learn-rust-demo written to /workspace/builds/worker-5-tc2/source/Cargo.toml [INFO] crate git repo https://github.com/breakinferno/learn-rust-demo 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" "+aa7c6ba69acce8b10a275eabfe6157ea72c8b599" "fetch" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [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-5-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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:2788e3201cd34a07e3172128adcd8b3090168a8e3bcc40d7c032b9dda1df7d1c" "/opt/rustwide/cargo-home/bin/cargo" "+aa7c6ba69acce8b10a275eabfe6157ea72c8b599" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] 4039d5c1d2b82dddd8b6d1f0c0c2db9ab738c683b0aa94e1a3ac6b96aab39ba5 [INFO] running `Command { std: "docker" "start" "-a" "4039d5c1d2b82dddd8b6d1f0c0c2db9ab738c683b0aa94e1a3ac6b96aab39ba5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "4039d5c1d2b82dddd8b6d1f0c0c2db9ab738c683b0aa94e1a3ac6b96aab39ba5", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "4039d5c1d2b82dddd8b6d1f0c0c2db9ab738c683b0aa94e1a3ac6b96aab39ba5", kill_on_drop: false }` [INFO] [stdout] 4039d5c1d2b82dddd8b6d1f0c0c2db9ab738c683b0aa94e1a3ac6b96aab39ba5 [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-tc2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-5-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:2788e3201cd34a07e3172128adcd8b3090168a8e3bcc40d7c032b9dda1df7d1c" "/opt/rustwide/cargo-home/bin/cargo" "+aa7c6ba69acce8b10a275eabfe6157ea72c8b599" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] b4f5d9f9488ec3b81af77888a8bad9815f2682a1e2451bff65e632ab8b0d4602 [INFO] running `Command { std: "docker" "start" "-a" "b4f5d9f9488ec3b81af77888a8bad9815f2682a1e2451bff65e632ab8b0d4602", kill_on_drop: false }` [INFO] [stderr] Compiling proc-macro2 v1.0.60 [INFO] [stderr] Compiling quote v1.0.28 [INFO] [stderr] Compiling syn v2.0.18 [INFO] [stderr] Compiling macro_define_crate v0.1.0 (/opt/rustwide/workdir/macro_define_crate) [INFO] [stdout] warning: unused imports: `Attribute`, `parse_macro_input` [INFO] [stdout] --> macro_define_crate/src/lib.rs:2:11 [INFO] [stdout] | [INFO] [stdout] 2 | use syn::{parse_macro_input, Attribute}; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^ ^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 1 warning emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Checking learn v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: variant `b` should have an upper camel case name [INFO] [stdout] --> src/main.rs:159:5 [INFO] [stdout] | [INFO] [stdout] 159 | b(i32), [INFO] [stdout] | ^ help: convert the identifier to upper camel case: `B` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant `b` should have an upper camel case name [INFO] [stdout] --> src/main.rs:159:5 [INFO] [stdout] | [INFO] [stdout] 159 | b(i32), [INFO] [stdout] | ^ help: convert the identifier to upper camel case: `B` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/mytrait.rs:47:34 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn notify_multi_trait_return(item: impl Summary + Display) -> impl Summary { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/mytrait.rs:47:34 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn notify_multi_trait_return(item: impl Summary + Display) -> impl Summary { [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item` [INFO] [stdout] --> src/mytrait.rs:43:27 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn notify_multi_trait(item: impl Summary + Display) { [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/mytrait.rs:52:56 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn notify_multi_trait_bounds(item: T) { [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/mytrait.rs:56:46 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn notify_multi_trait_bounds_where(item: T, key: U) [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `key` [INFO] [stdout] --> src/mytrait.rs:56:55 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn notify_multi_trait_bounds_where(item: T, key: U) [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_key` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> src/lifecycle.rs:14:28 [INFO] [stdout] | [INFO] [stdout] 14 | fn largest<'a>(a: &'a i32, b: &'a i32) -> &'a i32 { // 声明了一个声明周期,跟泛型一样,泛型式声明了一个类型。 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arg` [INFO] [stdout] --> src/lifecycle.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | fn life(arg: &'a str) -> &'a str { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_arg` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> src/lifecycle.rs:33:53 [INFO] [stdout] | [INFO] [stdout] 33 | fn test_dep_life<'a: 'b, 'b: 'c, 'c>(a: &'a String, b: &'b String) -> &'c String { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `z` [INFO] [stdout] --> src/lifecycle.rs:37:45 [INFO] [stdout] | [INFO] [stdout] 37 | fn difficult<'a, T>(x: &'a str, y: &'a str, z: T) -> &'a str [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `x` is assigned to, but never used [INFO] [stdout] --> src/closure.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | let mut x = add(5,7); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_x` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `x` is never read [INFO] [stdout] --> src/closure.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | x = bo(5,7); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `list_of_statues` [INFO] [stdout] --> src/closure.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | let list_of_statues: Vec = (0u32..20).map(Status::Value).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_list_of_statues` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `d` [INFO] [stdout] --> src/main.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | let d = demod::Demo {x:2}; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_d` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | let mut st2 = "字符串字面值".to_string(); [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: `item` [INFO] [stdout] --> src/mytrait.rs:43:27 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn notify_multi_trait(item: impl Summary + Display) { [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/mytrait.rs:52:56 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn notify_multi_trait_bounds(item: T) { [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/mytrait.rs:56:46 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn notify_multi_trait_bounds_where(item: T, key: U) [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_item` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `key` [INFO] [stdout] --> src/mytrait.rs:56:55 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn notify_multi_trait_bounds_where(item: T, key: U) [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_key` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> src/lifecycle.rs:14:28 [INFO] [stdout] | [INFO] [stdout] 14 | fn largest<'a>(a: &'a i32, b: &'a i32) -> &'a i32 { // 声明了一个声明周期,跟泛型一样,泛型式声明了一个类型。 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `arg` [INFO] [stdout] --> src/lifecycle.rs:19:13 [INFO] [stdout] | [INFO] [stdout] 19 | fn life(arg: &'a str) -> &'a str { [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_arg` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field `y` is never read [INFO] [stdout] --> src/main.rs:124:5 [INFO] [stdout] | [INFO] [stdout] 122 | struct Point { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 123 | x: T, [INFO] [stdout] 124 | y: U [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `y` is never used [INFO] [stdout] --> src/main.rs:131:8 [INFO] [stdout] | [INFO] [stdout] 127 | impl Point {// 针对类型T U实现方法 [INFO] [stdout] | ---------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 131 | fn y(&self) -> &U { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `cmp_display` is never used [INFO] [stdout] --> src/main.rs:143:8 [INFO] [stdout] | [INFO] [stdout] 142 | impl Point { [INFO] [stdout] | -------------------------------------------- method in this implementation [INFO] [stdout] 143 | fn cmp_display(&self) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `MyEnum` is never used [INFO] [stdout] --> src/main.rs:157:6 [INFO] [stdout] | [INFO] [stdout] 157 | enum MyEnum { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `b` [INFO] [stdout] --> src/lifecycle.rs:33:53 [INFO] [stdout] | [INFO] [stdout] 33 | fn test_dep_life<'a: 'b, 'b: 'c, 'c>(a: &'a String, b: &'b String) -> &'c String { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_b` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_open_file` is never used [INFO] [stdout] --> src/main.rs:166:4 [INFO] [stdout] | [INFO] [stdout] 166 | fn test_open_file() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify` is never used [INFO] [stdout] --> src/mytrait.rs:33:8 [INFO] [stdout] | [INFO] [stdout] 33 | pub fn notify(item: impl Summary, item2: impl Summary) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_trait_bounds` is never used [INFO] [stdout] --> src/mytrait.rs:38:8 [INFO] [stdout] | [INFO] [stdout] 38 | pub fn notify_trait_bounds(item: T, item2: T) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait` is never used [INFO] [stdout] --> src/mytrait.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn notify_multi_trait(item: impl Summary + Display) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait_return` is never used [INFO] [stdout] --> src/mytrait.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn notify_multi_trait_return(item: impl Summary + Display) -> impl Summary { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait_bounds` is never used [INFO] [stdout] --> src/mytrait.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn notify_multi_trait_bounds(item: T) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait_bounds_where` is never used [INFO] [stdout] --> src/mytrait.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn notify_multi_trait_bounds_where(item: T, key: U) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `z` [INFO] [stdout] --> src/lifecycle.rs:37:45 [INFO] [stdout] | [INFO] [stdout] 37 | fn difficult<'a, T>(x: &'a str, y: &'a str, z: T) -> &'a str [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_z` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Lifecycle` is never constructed [INFO] [stdout] --> src/lifecycle.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Lifecycle<'a> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `largest` is never used [INFO] [stdout] --> src/lifecycle.rs:14:4 [INFO] [stdout] | [INFO] [stdout] 14 | fn largest<'a>(a: &'a i32, b: &'a i32) -> &'a i32 { // 声明了一个声明周期,跟泛型一样,泛型式声明了一个类型。 [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `life`, `method_no_omit_lifecycle`, and `method` are never used [INFO] [stdout] --> src/lifecycle.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 18 | impl<'a> Lifecycle<'a> { [INFO] [stdout] | ---------------------- associated items in this implementation [INFO] [stdout] 19 | fn life(arg: &'a str) -> &'a str { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 23 | fn method_no_omit_lifecycle(&'a self) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 27 | fn method(&self) -> i32 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_dep_life` is never used [INFO] [stdout] --> src/lifecycle.rs:33:4 [INFO] [stdout] | [INFO] [stdout] 33 | fn test_dep_life<'a: 'b, 'b: 'c, 'c>(a: &'a String, b: &'b String) -> &'c String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `difficult` is never used [INFO] [stdout] --> src/lifecycle.rs:37:4 [INFO] [stdout] | [INFO] [stdout] 37 | fn difficult<'a, T>(x: &'a str, y: &'a str, z: T) -> &'a str [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_closure` is never used [INFO] [stdout] --> src/closure.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn test_closure() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `add` is never used [INFO] [stdout] --> src/closure.rs:8:4 [INFO] [stdout] | [INFO] [stdout] 8 | fn add(x: i32, y: i32) -> i32 { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_fn_pointer` is never used [INFO] [stdout] --> src/closure.rs:12:4 [INFO] [stdout] | [INFO] [stdout] 12 | fn test_fn_pointer() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cache` is never constructed [INFO] [stdout] --> src/closure.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | struct Cache [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `value` are never used [INFO] [stdout] --> src/closure.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 31 | / impl Cache [INFO] [stdout] 32 | | where [INFO] [stdout] 33 | | T: Fn(i32) -> i32, [INFO] [stdout] | |______________________- associated items in this implementation [INFO] [stdout] 34 | { [INFO] [stdout] 35 | fn new(method: T) -> Cache { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 42 | fn value(&mut self, arg: i32) -> i32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `add_once` is never used [INFO] [stdout] --> src/closure.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn add_once(x: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `do_more` is never used [INFO] [stdout] --> src/closure.rs:59:4 [INFO] [stdout] | [INFO] [stdout] 59 | fn do_more(f: fn(i32) -> i32, arg: i32) -> i32 { // fn 表示函数指针类型 [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `do_twice` is never used [INFO] [stdout] --> src/closure.rs:63:4 [INFO] [stdout] | [INFO] [stdout] 63 | fn do_twice(f: T, arg: i32) -> i32 [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Status` is never used [INFO] [stdout] --> src/closure.rs:70:6 [INFO] [stdout] | [INFO] [stdout] 70 | enum Status { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `return_closure` is never used [INFO] [stdout] --> src/closure.rs:75:4 [INFO] [stdout] | [INFO] [stdout] 75 | fn return_closure() -> impl Fn(i32) -> i32 { // 返回闭包需要闭包特征 [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `return_closure_pro` is never used [INFO] [stdout] --> src/closure.rs:79:4 [INFO] [stdout] | [INFO] [stdout] 79 | fn return_closure_pro(a: i32) -> Box i32> { // 返回闭包需要闭包特征 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test` is never used [INFO] [stdout] --> src/closure.rs:87:4 [INFO] [stdout] | [INFO] [stdout] 87 | fn test() { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused arithmetic operation that must be used [INFO] [stdout] --> src/main.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | st2 + &st3; [INFO] [stdout] | ^^^^^^^^^^ the arithmetic operation produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 52 | let _ = st2 + &st3; [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable `x` is assigned to, but never used [INFO] [stdout] --> src/closure.rs:13:13 [INFO] [stdout] | [INFO] [stdout] 13 | let mut x = add(5,7); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: consider using `_x` instead [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: value assigned to `x` is never read [INFO] [stdout] --> src/closure.rs:17:5 [INFO] [stdout] | [INFO] [stdout] 17 | x = bo(5,7); [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = help: maybe it is overwritten before being read? [INFO] [stdout] = note: `#[warn(unused_assignments)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `list_of_statues` [INFO] [stdout] --> src/closure.rs:90:9 [INFO] [stdout] | [INFO] [stdout] 90 | let list_of_statues: Vec = (0u32..20).map(Status::Value).collect(); [INFO] [stdout] | ^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_list_of_statues` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `d` [INFO] [stdout] --> src/main.rs:115:9 [INFO] [stdout] | [INFO] [stdout] 115 | let d = demod::Demo {x:2}; [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_d` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/main.rs:49:9 [INFO] [stdout] | [INFO] [stdout] 49 | let mut st2 = "字符串字面值".to_string(); [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: field `y` is never read [INFO] [stdout] --> src/main.rs:124:5 [INFO] [stdout] | [INFO] [stdout] 122 | struct Point { [INFO] [stdout] | ----- field in this struct [INFO] [stdout] 123 | x: T, [INFO] [stdout] 124 | y: U [INFO] [stdout] | ^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `y` is never used [INFO] [stdout] --> src/main.rs:131:8 [INFO] [stdout] | [INFO] [stdout] 127 | impl Point {// 针对类型T U实现方法 [INFO] [stdout] | ---------------------- method in this implementation [INFO] [stdout] ... [INFO] [stdout] 131 | fn y(&self) -> &U { [INFO] [stdout] | ^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: method `cmp_display` is never used [INFO] [stdout] --> src/main.rs:143:8 [INFO] [stdout] | [INFO] [stdout] 142 | impl Point { [INFO] [stdout] | -------------------------------------------- method in this implementation [INFO] [stdout] 143 | fn cmp_display(&self) { [INFO] [stdout] | ^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `MyEnum` is never used [INFO] [stdout] --> src/main.rs:157:6 [INFO] [stdout] | [INFO] [stdout] 157 | enum MyEnum { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_open_file` is never used [INFO] [stdout] --> src/main.rs:166:4 [INFO] [stdout] | [INFO] [stdout] 166 | fn test_open_file() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify` is never used [INFO] [stdout] --> src/mytrait.rs:33:8 [INFO] [stdout] | [INFO] [stdout] 33 | pub fn notify(item: impl Summary, item2: impl Summary) { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_trait_bounds` is never used [INFO] [stdout] --> src/mytrait.rs:38:8 [INFO] [stdout] | [INFO] [stdout] 38 | pub fn notify_trait_bounds(item: T, item2: T) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait` is never used [INFO] [stdout] --> src/mytrait.rs:43:8 [INFO] [stdout] | [INFO] [stdout] 43 | pub fn notify_multi_trait(item: impl Summary + Display) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait_return` is never used [INFO] [stdout] --> src/mytrait.rs:47:8 [INFO] [stdout] | [INFO] [stdout] 47 | pub fn notify_multi_trait_return(item: impl Summary + Display) -> impl Summary { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait_bounds` is never used [INFO] [stdout] --> src/mytrait.rs:52:8 [INFO] [stdout] | [INFO] [stdout] 52 | pub fn notify_multi_trait_bounds(item: T) { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `notify_multi_trait_bounds_where` is never used [INFO] [stdout] --> src/mytrait.rs:56:8 [INFO] [stdout] | [INFO] [stdout] 56 | pub fn notify_multi_trait_bounds_where(item: T, key: U) [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Lifecycle` is never constructed [INFO] [stdout] --> src/lifecycle.rs:3:12 [INFO] [stdout] | [INFO] [stdout] 3 | pub struct Lifecycle<'a> { [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `largest` is never used [INFO] [stdout] --> src/lifecycle.rs:14:4 [INFO] [stdout] | [INFO] [stdout] 14 | fn largest<'a>(a: &'a i32, b: &'a i32) -> &'a i32 { // 声明了一个声明周期,跟泛型一样,泛型式声明了一个类型。 [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `life`, `method_no_omit_lifecycle`, and `method` are never used [INFO] [stdout] --> src/lifecycle.rs:19:8 [INFO] [stdout] | [INFO] [stdout] 18 | impl<'a> Lifecycle<'a> { [INFO] [stdout] | ---------------------- associated items in this implementation [INFO] [stdout] 19 | fn life(arg: &'a str) -> &'a str { [INFO] [stdout] | ^^^^ [INFO] [stdout] ... [INFO] [stdout] 23 | fn method_no_omit_lifecycle(&'a self) -> i32 { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] ... [INFO] [stdout] 27 | fn method(&self) -> i32 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_dep_life` is never used [INFO] [stdout] --> src/lifecycle.rs:33:4 [INFO] [stdout] | [INFO] [stdout] 33 | fn test_dep_life<'a: 'b, 'b: 'c, 'c>(a: &'a String, b: &'b String) -> &'c String { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `difficult` is never used [INFO] [stdout] --> src/lifecycle.rs:37:4 [INFO] [stdout] | [INFO] [stdout] 37 | fn difficult<'a, T>(x: &'a str, y: &'a str, z: T) -> &'a str [INFO] [stdout] | ^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_closure` is never used [INFO] [stdout] --> src/closure.rs:1:8 [INFO] [stdout] | [INFO] [stdout] 1 | pub fn test_closure() { [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `add` is never used [INFO] [stdout] --> src/closure.rs:8:4 [INFO] [stdout] | [INFO] [stdout] 8 | fn add(x: i32, y: i32) -> i32 { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test_fn_pointer` is never used [INFO] [stdout] --> src/closure.rs:12:4 [INFO] [stdout] | [INFO] [stdout] 12 | fn test_fn_pointer() { [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct `Cache` is never constructed [INFO] [stdout] --> src/closure.rs:23:9 [INFO] [stdout] | [INFO] [stdout] 23 | struct Cache [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated items `new` and `value` are never used [INFO] [stdout] --> src/closure.rs:35:8 [INFO] [stdout] | [INFO] [stdout] 31 | / impl Cache [INFO] [stdout] 32 | | where [INFO] [stdout] 33 | | T: Fn(i32) -> i32, [INFO] [stdout] | |______________________- associated items in this implementation [INFO] [stdout] 34 | { [INFO] [stdout] 35 | fn new(method: T) -> Cache { [INFO] [stdout] | ^^^ [INFO] [stdout] ... [INFO] [stdout] 42 | fn value(&mut self, arg: i32) -> i32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `add_once` is never used [INFO] [stdout] --> src/closure.rs:55:4 [INFO] [stdout] | [INFO] [stdout] 55 | fn add_once(x: i32) -> i32 { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `do_more` is never used [INFO] [stdout] --> src/closure.rs:59:4 [INFO] [stdout] | [INFO] [stdout] 59 | fn do_more(f: fn(i32) -> i32, arg: i32) -> i32 { // fn 表示函数指针类型 [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `do_twice` is never used [INFO] [stdout] --> src/closure.rs:63:4 [INFO] [stdout] | [INFO] [stdout] 63 | fn do_twice(f: T, arg: i32) -> i32 [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum `Status` is never used [INFO] [stdout] --> src/closure.rs:70:6 [INFO] [stdout] | [INFO] [stdout] 70 | enum Status { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `return_closure` is never used [INFO] [stdout] --> src/closure.rs:75:4 [INFO] [stdout] | [INFO] [stdout] 75 | fn return_closure() -> impl Fn(i32) -> i32 { // 返回闭包需要闭包特征 [INFO] [stdout] | ^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `return_closure_pro` is never used [INFO] [stdout] --> src/closure.rs:79:4 [INFO] [stdout] | [INFO] [stdout] 79 | fn return_closure_pro(a: i32) -> Box i32> { // 返回闭包需要闭包特征 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `test` is never used [INFO] [stdout] --> src/closure.rs:87:4 [INFO] [stdout] | [INFO] [stdout] 87 | fn test() { [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused arithmetic operation that must be used [INFO] [stdout] --> src/main.rs:52:5 [INFO] [stdout] | [INFO] [stdout] 52 | st2 + &st3; [INFO] [stdout] | ^^^^^^^^^^ the arithmetic operation produces a value [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_must_use)]` on by default [INFO] [stdout] help: use `let _ = ...` to ignore the resulting value [INFO] [stdout] | [INFO] [stdout] 52 | let _ = st2 + &st3; [INFO] [stdout] | +++++++ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 44 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 44 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 4.08s [INFO] running `Command { std: "docker" "inspect" "b4f5d9f9488ec3b81af77888a8bad9815f2682a1e2451bff65e632ab8b0d4602", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "b4f5d9f9488ec3b81af77888a8bad9815f2682a1e2451bff65e632ab8b0d4602", kill_on_drop: false }` [INFO] [stdout] b4f5d9f9488ec3b81af77888a8bad9815f2682a1e2451bff65e632ab8b0d4602