[INFO] updating cached repository wyl206/rust_kmeans [INFO] running `"git" "fetch" "--all"` [INFO] [stdout] Fetching origin [INFO] [stderr] From git://github.com/wyl206/rust_kmeans [INFO] [stderr] * branch HEAD -> FETCH_HEAD [INFO] running `"git" "clone" "work/cache/sources/gh/wyl206/rust_kmeans" "work/ex/clippy-test-run/sources/stable/gh/wyl206/rust_kmeans"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable/gh/wyl206/rust_kmeans'... [INFO] [stderr] done. [INFO] running `"git" "clone" "work/cache/sources/gh/wyl206/rust_kmeans" "work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/wyl206/rust_kmeans"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/wyl206/rust_kmeans'... [INFO] [stderr] done. [INFO] running `"git" "rev-parse" "HEAD"` [INFO] [stdout] 19c8a9a377a2212dc4919bd95b5229dd8a690ea0 [INFO] sha for GitHub repo wyl206/rust_kmeans: 19c8a9a377a2212dc4919bd95b5229dd8a690ea0 [INFO] validating manifest of wyl206/rust_kmeans on toolchain stable [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] validating manifest of wyl206/rust_kmeans on toolchain stable+rustflags=-Dclippy::into_iter_on_array [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "read-manifest" "--manifest-path" "Cargo.toml"` [INFO] started frobbing wyl206/rust_kmeans [INFO] finished frobbing wyl206/rust_kmeans [INFO] frobbed toml for wyl206/rust_kmeans written to work/ex/clippy-test-run/sources/stable/gh/wyl206/rust_kmeans/Cargo.toml [INFO] started frobbing wyl206/rust_kmeans [INFO] finished frobbing wyl206/rust_kmeans [INFO] frobbed toml for wyl206/rust_kmeans written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/wyl206/rust_kmeans/Cargo.toml [INFO] crate wyl206/rust_kmeans has a lockfile. skipping [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "fetch" "--locked" "--manifest-path" "Cargo.toml"` [INFO] linting wyl206/rust_kmeans against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-7/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/gh/wyl206/rust_kmeans:/opt/crater/workdir:ro,Z" "-v" "/mnt/big/crater/work/local/cargo-home:/opt/crater/cargo-home:ro,Z" "-v" "/mnt/big/crater/work/local/rustup-home:/opt/crater/rustup-home:ro,Z" "-e" "USER_ID=1000" "-e" "SOURCE_DIR=/opt/crater/workdir" "-e" "MAP_USER_ID=1000" "-e" "CARGO_TARGET_DIR=/opt/crater/target" "-e" "CARGO_INCREMENTAL=0" "-e" "RUST_BACKTRACE=full" "-e" "RUSTFLAGS=--cap-lints=forbid" "-e" "CARGO_HOME=/opt/crater/cargo-home" "-e" "RUSTUP_HOME=/opt/crater/rustup-home" "-w" "/opt/crater/workdir" "-m" "1536M" "--network" "none" "rustops/crates-build-env" "/opt/crater/cargo-home/bin/cargo" "+stable" "clippy" "--frozen" "--all" "--all-targets"` [INFO] [stdout] 857a4a279fe36e662c9312a3a2464b0691e3fa8a6470c853bc457ba87c46bf81 [INFO] running `"docker" "start" "-a" "857a4a279fe36e662c9312a3a2464b0691e3fa8a6470c853bc457ba87c46bf81"` [INFO] [stderr] Checking kmeans v0.1.0 (/opt/crater/workdir) [INFO] [stderr] warning: methods called `new` usually take no self; consider choosing a less ambiguous name [INFO] [stderr] --> src/km.rs:21:16 [INFO] [stderr] | [INFO] [stderr] 21 | pub fn new(&mut self, def_k: u8, def_dim: u8) { [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::wrong_self_convention)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: methods called `new` usually return `Self` [INFO] [stderr] --> src/km.rs:21:5 [INFO] [stderr] | [INFO] [stderr] 21 | / pub fn new(&mut self, def_k: u8, def_dim: u8) { [INFO] [stderr] 22 | | self.k = def_k; // defalut 2 kmeans [INFO] [stderr] 23 | | self.datanum = 0; [INFO] [stderr] 24 | | self.sse = 1; [INFO] [stderr] 25 | | self.datadim = def_dim; [INFO] [stderr] 26 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::new_ret_no_self)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:27:43 [INFO] [stderr] | [INFO] [stderr] 27 | pub fn input_data(&mut self, onedata: &Vec) { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: use of `or_insert` followed by a function call [INFO] [stderr] --> src/km.rs:29:39 [INFO] [stderr] | [INFO] [stderr] 29 | self.data.entry(self.datanum).or_insert(onedata.to_vec()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(|| onedata.to_vec())` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::or_fun_call)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:55:36 [INFO] [stderr] | [INFO] [stderr] 55 | fn compute_distance(&self, v1: &Vec, v2: &Vec) -> f32 { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:55:51 [INFO] [stderr] | [INFO] [stderr] 55 | fn compute_distance(&self, v1: &Vec, v2: &Vec) -> f32 { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:82:28 [INFO] [stderr] | [INFO] [stderr] 82 | fn add_data(&self, v1: &Vec, v2: &Vec) -> Vec { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:82:43 [INFO] [stderr] | [INFO] [stderr] 82 | fn add_data(&self, v1: &Vec, v2: &Vec) -> Vec { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:92:30 [INFO] [stderr] | [INFO] [stderr] 92 | fn divide_num(&self, v1: &Vec, total: i32) -> Vec { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise [INFO] [stderr] --> src/km.rs:115:25 [INFO] [stderr] | [INFO] [stderr] 115 | let total = classnum.get(i as usize).unwrap(); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `classnum[i as usize]` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::get_unwrap)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap [INFO] [stderr] [INFO] [stderr] warning: methods called `new` usually take no self; consider choosing a less ambiguous name [INFO] [stderr] --> src/km.rs:21:16 [INFO] [stderr] | [INFO] [stderr] 21 | pub fn new(&mut self, def_k: u8, def_dim: u8) { [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::wrong_self_convention)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#wrong_self_convention [INFO] [stderr] [INFO] [stderr] warning: methods called `new` usually return `Self` [INFO] [stderr] --> src/km.rs:21:5 [INFO] [stderr] | [INFO] [stderr] 21 | / pub fn new(&mut self, def_k: u8, def_dim: u8) { [INFO] [stderr] 22 | | self.k = def_k; // defalut 2 kmeans [INFO] [stderr] 23 | | self.datanum = 0; [INFO] [stderr] 24 | | self.sse = 1; [INFO] [stderr] 25 | | self.datadim = def_dim; [INFO] [stderr] 26 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::new_ret_no_self)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_ret_no_self [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:27:43 [INFO] [stderr] | [INFO] [stderr] 27 | pub fn input_data(&mut self, onedata: &Vec) { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::ptr_arg)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: use of `or_insert` followed by a function call [INFO] [stderr] --> src/km.rs:29:39 [INFO] [stderr] | [INFO] [stderr] 29 | self.data.entry(self.datanum).or_insert(onedata.to_vec()); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `or_insert_with(|| onedata.to_vec())` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::or_fun_call)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#or_fun_call [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:55:36 [INFO] [stderr] | [INFO] [stderr] 55 | fn compute_distance(&self, v1: &Vec, v2: &Vec) -> f32 { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:55:51 [INFO] [stderr] | [INFO] [stderr] 55 | fn compute_distance(&self, v1: &Vec, v2: &Vec) -> f32 { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:82:28 [INFO] [stderr] | [INFO] [stderr] 82 | fn add_data(&self, v1: &Vec, v2: &Vec) -> Vec { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:82:43 [INFO] [stderr] | [INFO] [stderr] 82 | fn add_data(&self, v1: &Vec, v2: &Vec) -> Vec { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: writing `&Vec<_>` instead of `&[_]` involves one more reference and cannot be used with non-Vec-based slices. [INFO] [stderr] --> src/km.rs:92:30 [INFO] [stderr] | [INFO] [stderr] 92 | fn divide_num(&self, v1: &Vec, total: i32) -> Vec { [INFO] [stderr] | ^^^^^^^^^ help: change this to: `&[f32]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise [INFO] [stderr] --> src/km.rs:115:25 [INFO] [stderr] | [INFO] [stderr] 115 | let total = classnum.get(i as usize).unwrap(); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `classnum[i as usize]` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::get_unwrap)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:15:9 [INFO] [stderr] | [INFO] [stderr] 15 | k: k, [INFO] [stderr] | ^^^^ help: replace it with: `k` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:19:9 [INFO] [stderr] | [INFO] [stderr] 19 | datanum: datanum, [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: replace it with: `datanum` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:20:9 [INFO] [stderr] | [INFO] [stderr] 20 | datadim: datadim, [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: replace it with: `datadim` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:15:9 [INFO] [stderr] | [INFO] [stderr] 15 | k: k, [INFO] [stderr] | ^^^^ help: replace it with: `k` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::redundant_field_names)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:19:9 [INFO] [stderr] | [INFO] [stderr] 19 | datanum: datanum, [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: replace it with: `datanum` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] warning: redundant field names in struct initialization [INFO] [stderr] --> src/main.rs:20:9 [INFO] [stderr] | [INFO] [stderr] 20 | datadim: datadim, [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: replace it with: `datadim` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names [INFO] [stderr] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 1.70s [INFO] running `"docker" "inspect" "857a4a279fe36e662c9312a3a2464b0691e3fa8a6470c853bc457ba87c46bf81"` [INFO] running `"docker" "rm" "-f" "857a4a279fe36e662c9312a3a2464b0691e3fa8a6470c853bc457ba87c46bf81"` [INFO] [stdout] 857a4a279fe36e662c9312a3a2464b0691e3fa8a6470c853bc457ba87c46bf81