[INFO] cloning repository https://github.com/lazylook2/rust_study [INFO] running `Command { std: "git" "-c" "credential.helper=" "-c" "credential.helper=/workspace/cargo-home/bin/git-credential-null" "clone" "--bare" "https://github.com/lazylook2/rust_study" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flazylook2%2Frust_study", kill_on_drop: false }` [INFO] [stderr] Cloning into bare repository '/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flazylook2%2Frust_study'... [INFO] running `Command { std: "git" "rev-parse" "HEAD", kill_on_drop: false }` [INFO] [stdout] e091f734aa7eeb5f5f641997026d248ba730361c [INFO] checking lazylook2/rust_study against try#c8bdaa84ec1b37f18f30375e196a65b7602f3790 for pr-73345 [INFO] running `Command { std: "git" "clone" "/workspace/cache/git-repos/https%3A%2F%2Fgithub.com%2Flazylook2%2Frust_study" "/workspace/builds/worker-2/source", kill_on_drop: false }` [INFO] [stderr] Cloning into '/workspace/builds/worker-2/source'... [INFO] [stderr] done. [INFO] validating manifest of git repo https://github.com/lazylook2/rust_study on toolchain c8bdaa84ec1b37f18f30375e196a65b7602f3790 [INFO] running `Command { std: "/workspace/cargo-home/bin/cargo" "+c8bdaa84ec1b37f18f30375e196a65b7602f3790" "read-manifest" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] started tweaking git repo https://github.com/lazylook2/rust_study [INFO] finished tweaking git repo https://github.com/lazylook2/rust_study [INFO] tweaked toml for git repo https://github.com/lazylook2/rust_study written to /workspace/builds/worker-2/source/Cargo.toml [INFO] crate git repo https://github.com/lazylook2/rust_study already has a lockfile, it will not be regenerated [INFO] running `Command { std: "/workspace/cargo-home/bin/cargo" "+c8bdaa84ec1b37f18f30375e196a65b7602f3790" "fetch" "--locked" "--manifest-path" "Cargo.toml", kill_on_drop: false }` [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2/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" "MAP_USER_ID=0" "-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" "--network" "none" "rustops/crates-build-env@sha256:6c9ffe128752d56c8d75334ed354142a5229917ed99767f56566dd8e857ad726" "/opt/rustwide/cargo-home/bin/cargo" "+c8bdaa84ec1b37f18f30375e196a65b7602f3790" "metadata" "--no-deps" "--format-version=1", kill_on_drop: false }` [INFO] [stdout] e2d597e475512813813f4e6960f4ecee99282569be16280230f2d545a2b84b2a [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" "e2d597e475512813813f4e6960f4ecee99282569be16280230f2d545a2b84b2a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "inspect" "e2d597e475512813813f4e6960f4ecee99282569be16280230f2d545a2b84b2a", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "e2d597e475512813813f4e6960f4ecee99282569be16280230f2d545a2b84b2a", kill_on_drop: false }` [INFO] [stdout] e2d597e475512813813f4e6960f4ecee99282569be16280230f2d545a2b84b2a [INFO] running `Command { std: "docker" "create" "-v" "/var/lib/crater-agent-workspace/builds/worker-2/target:/opt/rustwide/target:rw,Z" "-v" "/var/lib/crater-agent-workspace/builds/worker-2/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" "MAP_USER_ID=0" "-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" "--network" "none" "rustops/crates-build-env@sha256:6c9ffe128752d56c8d75334ed354142a5229917ed99767f56566dd8e857ad726" "/opt/rustwide/cargo-home/bin/cargo" "+c8bdaa84ec1b37f18f30375e196a65b7602f3790" "check" "--frozen" "--all" "--all-targets" "--message-format=json", kill_on_drop: false }` [INFO] [stdout] d549f70ae038df6c076f92955c9f482aa4f0683d4d06c103363dc7373d3f95b4 [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" "d549f70ae038df6c076f92955c9f482aa4f0683d4d06c103363dc7373d3f95b4", kill_on_drop: false }` [INFO] [stderr] sudo: setrlimit(RLIMIT_CORE): Operation not permitted [INFO] [stderr] Checking rust_study v0.1.0 (/opt/rustwide/workdir) [INFO] [stdout] warning: unused imports: `ErrorKind`, `Error` [INFO] [stdout] --> src/error.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{ErrorKind, Read, Error}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `teacher` should have an upper camel case name [INFO] [stdout] --> src/generics_trait.rs:73:15 [INFO] [stdout] | [INFO] [stdout] 73 | pub trait teacher { [INFO] [stdout] | ^^^^^^^ help: convert the identifier to upper camel case: `Teacher` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `ErrorKind`, `Error` [INFO] [stdout] --> src/error.rs:2:15 [INFO] [stdout] | [INFO] [stdout] 2 | use std::io::{ErrorKind, Read, Error}; [INFO] [stdout] | ^^^^^^^^^ ^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: trait `teacher` should have an upper camel case name [INFO] [stdout] --> src/generics_trait.rs:73:15 [INFO] [stdout] | [INFO] [stdout] 73 | pub trait teacher { [INFO] [stdout] | ^^^^^^^ help: convert the identifier to upper camel case: `Teacher` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_camel_case_types)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/common.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | let y = { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `number` [INFO] [stdout] --> src/common.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | let number = if condition { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_number` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `user1` [INFO] [stdout] --> src/structs.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let user1 = User{ [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_user1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `user2` [INFO] [stdout] --> src/structs.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let user2 = User{ [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_user2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `four` [INFO] [stdout] --> src/enum_match.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | let four = IpAddKind::V4; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_four` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `home` [INFO] [stdout] --> src/enum_match.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | let home = IpAddr{ kind: IpAddKind::V4, address: String::from("127.0.0.1") }; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_home` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ip_type` [INFO] [stdout] --> src/enum_match.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | fn route (ip_type: IpAddKind) { } [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ip_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/collections.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | 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: `first` [INFO] [stdout] --> src/collections.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let first = &v[0]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_first` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `row` [INFO] [stdout] --> src/collections.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | let row = vec![ [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_row` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let mut s = String::new(); // String 这样拥有所有权,被移动就回不来了 [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | let s = data.to_string(); // String [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | let s = "initial contents".to_string(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | let s = String::from("initial contents"); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let s = s1 + "-" + &s2; // String 和 &str。s1 被移动了,不能继续使用 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `hello` [INFO] [stdout] --> src/collections.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | let hello = &s[0..5]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_hello` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `world` [INFO] [stdout] --> src/collections.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | let world = &s[6..11]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_world` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/collections.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | let slice = &a[1..3]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/collections.rs:96:9 [INFO] [stdout] | [INFO] [stdout] 96 | let word = first_word(&s); // word 的值为 5 [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `scores` [INFO] [stdout] --> src/collections.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | let scores: HashMap<_, _> = teams.iter().zip(initial_scores.iter()).collect(); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_scores` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `integer` [INFO] [stdout] --> src/generics_trait.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let integer = Point{ x: 5, y: 10 }; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_integer` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/generics_trait.rs:107:43 [INFO] [stdout] | [INFO] [stdout] 107 | pub fn notify2 (item1: &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: `t` [INFO] [stdout] --> src/generics_trait.rs:115:28 [INFO] [stdout] | [INFO] [stdout] 115 | fn some_function(t: T, u: U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> src/generics_trait.rs:115:34 [INFO] [stdout] | [INFO] [stdout] 115 | fn some_function(t: T, u: U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `string2` [INFO] [stdout] --> src/generics_trait.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | let string2 = String::from("xyz"); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_string2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/generics_trait.rs:248:33 [INFO] [stdout] | [INFO] [stdout] 248 | fn longest2<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/collections.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let mut s = String::new(); // 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: `y` [INFO] [stdout] --> src/common.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | let y = { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_variables)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `number` [INFO] [stdout] --> src/common.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | let number = if condition { [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_number` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `user1` [INFO] [stdout] --> src/structs.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | let user1 = User{ [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_user1` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `user2` [INFO] [stdout] --> src/structs.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let user2 = User{ [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_user2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `four` [INFO] [stdout] --> src/enum_match.rs:3:9 [INFO] [stdout] | [INFO] [stdout] 3 | let four = IpAddKind::V4; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_four` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `home` [INFO] [stdout] --> src/enum_match.rs:10:9 [INFO] [stdout] | [INFO] [stdout] 10 | let home = IpAddr{ kind: IpAddKind::V4, address: String::from("127.0.0.1") }; [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_home` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `ip_type` [INFO] [stdout] --> src/enum_match.rs:4:15 [INFO] [stdout] | [INFO] [stdout] 4 | fn route (ip_type: IpAddKind) { } [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_ip_type` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `v` [INFO] [stdout] --> src/collections.rs:4:9 [INFO] [stdout] | [INFO] [stdout] 4 | 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: `first` [INFO] [stdout] --> src/collections.rs:18:9 [INFO] [stdout] | [INFO] [stdout] 18 | let first = &v[0]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_first` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `row` [INFO] [stdout] --> src/collections.rs:43:9 [INFO] [stdout] | [INFO] [stdout] 43 | let row = vec![ [INFO] [stdout] | ^^^ help: if this is intentional, prefix it with an underscore: `_row` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let mut s = String::new(); // String 这样拥有所有权,被移动就回不来了 [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:52:9 [INFO] [stdout] | [INFO] [stdout] 52 | let s = data.to_string(); // String [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:53:9 [INFO] [stdout] | [INFO] [stdout] 53 | let s = "initial contents".to_string(); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:54:9 [INFO] [stdout] | [INFO] [stdout] 54 | let s = String::from("initial contents"); [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `s` [INFO] [stdout] --> src/collections.rs:62:9 [INFO] [stdout] | [INFO] [stdout] 62 | let s = s1 + "-" + &s2; // String 和 &str。s1 被移动了,不能继续使用 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_s` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `hello` [INFO] [stdout] --> src/collections.rs:72:9 [INFO] [stdout] | [INFO] [stdout] 72 | let hello = &s[0..5]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_hello` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `world` [INFO] [stdout] --> src/collections.rs:73:9 [INFO] [stdout] | [INFO] [stdout] 73 | let world = &s[6..11]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_world` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `slice` [INFO] [stdout] --> src/collections.rs:76:9 [INFO] [stdout] | [INFO] [stdout] 76 | let slice = &a[1..3]; [INFO] [stdout] | ^^^^^ help: if this is intentional, prefix it with an underscore: `_slice` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `word` [INFO] [stdout] --> src/collections.rs:96:9 [INFO] [stdout] | [INFO] [stdout] 96 | let word = first_word(&s); // word 的值为 5 [INFO] [stdout] | ^^^^ help: if this is intentional, prefix it with an underscore: `_word` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `scores` [INFO] [stdout] --> src/collections.rs:125:9 [INFO] [stdout] | [INFO] [stdout] 125 | let scores: HashMap<_, _> = teams.iter().zip(initial_scores.iter()).collect(); [INFO] [stdout] | ^^^^^^ help: if this is intentional, prefix it with an underscore: `_scores` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `integer` [INFO] [stdout] --> src/generics_trait.rs:32:9 [INFO] [stdout] | [INFO] [stdout] 32 | let integer = Point{ x: 5, y: 10 }; [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_integer` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `item2` [INFO] [stdout] --> src/generics_trait.rs:107:43 [INFO] [stdout] | [INFO] [stdout] 107 | pub fn notify2 (item1: &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: `t` [INFO] [stdout] --> src/generics_trait.rs:115:28 [INFO] [stdout] | [INFO] [stdout] 115 | fn some_function(t: T, u: U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_t` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `u` [INFO] [stdout] --> src/generics_trait.rs:115:34 [INFO] [stdout] | [INFO] [stdout] 115 | fn some_function(t: T, u: U) -> i32 [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_u` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `string2` [INFO] [stdout] --> src/generics_trait.rs:241:13 [INFO] [stdout] | [INFO] [stdout] 241 | let string2 = String::from("xyz"); [INFO] [stdout] | ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_string2` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused variable: `y` [INFO] [stdout] --> src/generics_trait.rs:248:33 [INFO] [stdout] | [INFO] [stdout] 248 | fn longest2<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^ help: if this is intentional, prefix it with an underscore: `_y` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/error.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 90 | let mut guess = String::new(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/error.rs:48:13 [INFO] [stdout] | [INFO] [stdout] 48 | let mut f = File::open("fuck.txt"); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `active` [INFO] [stdout] --> src/structs.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | active: bool, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `build_user` [INFO] [stdout] --> src/structs.rs:23:8 [INFO] [stdout] | [INFO] [stdout] 23 | fn build_user(username: String) -> User{ [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `can_hold` [INFO] [stdout] --> src/structs.rs:65:12 [INFO] [stdout] | [INFO] [stdout] 65 | fn can_hold(&self, other: &Rectangle) -> bool{ [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `V6` [INFO] [stdout] --> src/enum_match.rs:2:24 [INFO] [stdout] | [INFO] [stdout] 2 | enum IpAddKind {V4,V6,} [INFO] [stdout] | ^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `kind` [INFO] [stdout] --> src/enum_match.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | kind: IpAddKind, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `address` [INFO] [stdout] --> src/enum_match.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | address: String, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Quit` [INFO] [stdout] --> src/enum_match.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | Quit, // 没有关联任何数据 [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Move` [INFO] [stdout] --> src/enum_match.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | Move {x: i32, y: i32}, // 包含一个匿名结构体 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `ChangeColor` [INFO] [stdout] --> src/enum_match.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | ChangeColor(i32, i32, i32), // 包含三个 i32 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `read_username_from_file1` [INFO] [stdout] --> src/error.rs:69:8 [INFO] [stdout] | [INFO] [stdout] 69 | fn read_username_from_file1() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Guess` [INFO] [stdout] --> src/error.rs:104:16 [INFO] [stdout] | [INFO] [stdout] 104 | pub struct Guess { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `new` [INFO] [stdout] --> src/error.rs:109:16 [INFO] [stdout] | [INFO] [stdout] 109 | pub fn new(value: i32) -> Guess { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `value` [INFO] [stdout] --> src/error.rs:117:16 [INFO] [stdout] | [INFO] [stdout] 117 | pub fn value(&self) -> i32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `y` [INFO] [stdout] --> src/generics_trait.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | y: T, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum is never used: `Option` [INFO] [stdout] --> src/generics_trait.rs:34:10 [INFO] [stdout] | [INFO] [stdout] 34 | enum Option { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum is never used: `Result` [INFO] [stdout] --> src/generics_trait.rs:38:10 [INFO] [stdout] | [INFO] [stdout] 38 | enum Result { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Point1` [INFO] [stdout] --> src/generics_trait.rs:50:12 [INFO] [stdout] | [INFO] [stdout] 50 | struct Point1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `mixup` [INFO] [stdout] --> src/generics_trait.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | fn mixup(self, other: Point1) -> Point1 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify` [INFO] [stdout] --> src/generics_trait.rs:100:12 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn notify(item: impl School){ [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify1` [INFO] [stdout] --> src/generics_trait.rs:104:12 [INFO] [stdout] | [INFO] [stdout] 104 | pub fn notify1 (item: &T) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify2` [INFO] [stdout] --> src/generics_trait.rs:107:12 [INFO] [stdout] | [INFO] [stdout] 107 | pub fn notify2 (item1: &T, item2: &T) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify3` [INFO] [stdout] --> src/generics_trait.rs:111:12 [INFO] [stdout] | [INFO] [stdout] 111 | pub fn notify3(item: T) -> String{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `some_function` [INFO] [stdout] --> src/generics_trait.rs:115:8 [INFO] [stdout] | [INFO] [stdout] 115 | fn some_function(t: T, u: U) -> i32 [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `return_school` [INFO] [stdout] --> src/generics_trait.rs:122:8 [INFO] [stdout] | [INFO] [stdout] 122 | fn return_school() -> impl School { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `longest2` [INFO] [stdout] --> src/generics_trait.rs:248:8 [INFO] [stdout] | [INFO] [stdout] 248 | fn longest2<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/collections.rs:51:9 [INFO] [stdout] | [INFO] [stdout] 51 | let mut s = String::new(); // 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: function `String1` should have a snake case name [INFO] [stdout] --> src/collections.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn String1() { [INFO] [stdout] | ^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `string1` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 57 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/error.rs:90:13 [INFO] [stdout] | [INFO] [stdout] 90 | let mut guess = String::new(); [INFO] [stdout] | ----^^^^^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variable does not need to be mutable [INFO] [stdout] --> src/error.rs:48:13 [INFO] [stdout] | [INFO] [stdout] 48 | let mut f = File::open("fuck.txt"); [INFO] [stdout] | ----^ [INFO] [stdout] | | [INFO] [stdout] | help: remove this `mut` [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `active` [INFO] [stdout] --> src/structs.rs:6:9 [INFO] [stdout] | [INFO] [stdout] 6 | active: bool, [INFO] [stdout] | ^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(dead_code)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `build_user` [INFO] [stdout] --> src/structs.rs:23:8 [INFO] [stdout] | [INFO] [stdout] 23 | fn build_user(username: String) -> User{ [INFO] [stdout] | ^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `can_hold` [INFO] [stdout] --> src/structs.rs:65:12 [INFO] [stdout] | [INFO] [stdout] 65 | fn can_hold(&self, other: &Rectangle) -> bool{ [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `V6` [INFO] [stdout] --> src/enum_match.rs:2:24 [INFO] [stdout] | [INFO] [stdout] 2 | enum IpAddKind {V4,V6,} [INFO] [stdout] | ^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `kind` [INFO] [stdout] --> src/enum_match.rs:7:9 [INFO] [stdout] | [INFO] [stdout] 7 | kind: IpAddKind, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `address` [INFO] [stdout] --> src/enum_match.rs:8:9 [INFO] [stdout] | [INFO] [stdout] 8 | address: String, [INFO] [stdout] | ^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Quit` [INFO] [stdout] --> src/enum_match.rs:13:9 [INFO] [stdout] | [INFO] [stdout] 13 | Quit, // 没有关联任何数据 [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `Move` [INFO] [stdout] --> src/enum_match.rs:14:9 [INFO] [stdout] | [INFO] [stdout] 14 | Move {x: i32, y: i32}, // 包含一个匿名结构体 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: variant is never constructed: `ChangeColor` [INFO] [stdout] --> src/enum_match.rs:16:9 [INFO] [stdout] | [INFO] [stdout] 16 | ChangeColor(i32, i32, i32), // 包含三个 i32 [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `read_username_from_file1` [INFO] [stdout] --> src/error.rs:69:8 [INFO] [stdout] | [INFO] [stdout] 69 | fn read_username_from_file1() -> Result { [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Guess` [INFO] [stdout] --> src/error.rs:104:16 [INFO] [stdout] | [INFO] [stdout] 104 | pub struct Guess { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `new` [INFO] [stdout] --> src/error.rs:109:16 [INFO] [stdout] | [INFO] [stdout] 109 | pub fn new(value: i32) -> Guess { [INFO] [stdout] | ^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `value` [INFO] [stdout] --> src/error.rs:117:16 [INFO] [stdout] | [INFO] [stdout] 117 | pub fn value(&self) -> i32 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: field is never read: `y` [INFO] [stdout] --> src/generics_trait.rs:30:9 [INFO] [stdout] | [INFO] [stdout] 30 | y: T, [INFO] [stdout] | ^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum is never used: `Option` [INFO] [stdout] --> src/generics_trait.rs:34:10 [INFO] [stdout] | [INFO] [stdout] 34 | enum Option { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: enum is never used: `Result` [INFO] [stdout] --> src/generics_trait.rs:38:10 [INFO] [stdout] | [INFO] [stdout] 38 | enum Result { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: struct is never constructed: `Point1` [INFO] [stdout] --> src/generics_trait.rs:50:12 [INFO] [stdout] | [INFO] [stdout] 50 | struct Point1 { [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: associated function is never used: `mixup` [INFO] [stdout] --> src/generics_trait.rs:55:12 [INFO] [stdout] | [INFO] [stdout] 55 | fn mixup(self, other: Point1) -> Point1 { [INFO] [stdout] | ^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify` [INFO] [stdout] --> src/generics_trait.rs:100:12 [INFO] [stdout] | [INFO] [stdout] 100 | pub fn notify(item: impl School){ [INFO] [stdout] | ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify1` [INFO] [stdout] --> src/generics_trait.rs:104:12 [INFO] [stdout] | [INFO] [stdout] 104 | pub fn notify1 (item: &T) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify2` [INFO] [stdout] --> src/generics_trait.rs:107:12 [INFO] [stdout] | [INFO] [stdout] 107 | pub fn notify2 (item1: &T, item2: &T) { [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `notify3` [INFO] [stdout] --> src/generics_trait.rs:111:12 [INFO] [stdout] | [INFO] [stdout] 111 | pub fn notify3(item: T) -> String{ [INFO] [stdout] | ^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `some_function` [INFO] [stdout] --> src/generics_trait.rs:115:8 [INFO] [stdout] | [INFO] [stdout] 115 | fn some_function(t: T, u: U) -> i32 [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `return_school` [INFO] [stdout] --> src/generics_trait.rs:122:8 [INFO] [stdout] | [INFO] [stdout] 122 | fn return_school() -> impl School { [INFO] [stdout] | ^^^^^^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function is never used: `longest2` [INFO] [stdout] --> src/generics_trait.rs:248:8 [INFO] [stdout] | [INFO] [stdout] 248 | fn longest2<'a>(x: &'a str, y: &str) -> &'a str { [INFO] [stdout] | ^^^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: function `String1` should have a snake case name [INFO] [stdout] --> src/collections.rs:49:8 [INFO] [stdout] | [INFO] [stdout] 49 | pub fn String1() { [INFO] [stdout] | ^^^^^^^ help: convert the identifier to snake case (notice the capitalization): `string1` [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(non_snake_case)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 57 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rust_study::error::e2` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use rust_study::error::e2; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `generics`, `traits` [INFO] [stdout] --> src/main.rs:4:34 [INFO] [stdout] | [INFO] [stdout] 4 | use rust_study::generics_trait::{generics, traits, lifetime}; [INFO] [stdout] | ^^^^^^^^ ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 2 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused import: `rust_study::error::e2` [INFO] [stdout] --> src/main.rs:3:5 [INFO] [stdout] | [INFO] [stdout] 3 | use rust_study::error::e2; [INFO] [stdout] | ^^^^^^^^^^^^^^^^^^^^^ [INFO] [stdout] | [INFO] [stdout] = note: `#[warn(unused_imports)]` on by default [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: unused imports: `generics`, `traits` [INFO] [stdout] --> src/main.rs:4:34 [INFO] [stdout] | [INFO] [stdout] 4 | use rust_study::generics_trait::{generics, traits, lifetime}; [INFO] [stdout] | ^^^^^^^^ ^^^^^^ [INFO] [stdout] [INFO] [stdout] [INFO] [stdout] warning: 2 warnings emitted [INFO] [stdout] [INFO] [stdout] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 1.21s [INFO] running `Command { std: "docker" "inspect" "d549f70ae038df6c076f92955c9f482aa4f0683d4d06c103363dc7373d3f95b4", kill_on_drop: false }` [INFO] running `Command { std: "docker" "rm" "-f" "d549f70ae038df6c076f92955c9f482aa4f0683d4d06c103363dc7373d3f95b4", kill_on_drop: false }` [INFO] [stdout] d549f70ae038df6c076f92955c9f482aa4f0683d4d06c103363dc7373d3f95b4