[INFO] updating cached repository GovTechSG/chkr [INFO] running `"git" "fetch" "--all"` [INFO] [stdout] Fetching origin [INFO] [stderr] From git://github.com/GovTechSG/chkr [INFO] [stderr] * branch HEAD -> FETCH_HEAD [INFO] running `"git" "clone" "work/cache/sources/gh/GovTechSG/chkr" "work/ex/clippy-test-run/sources/stable/gh/GovTechSG/chkr"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable/gh/GovTechSG/chkr'... [INFO] [stderr] done. [INFO] running `"git" "clone" "work/cache/sources/gh/GovTechSG/chkr" "work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/GovTechSG/chkr"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/GovTechSG/chkr'... [INFO] [stderr] done. [INFO] running `"git" "rev-parse" "HEAD"` [INFO] [stdout] 767e4218499563f16683fc0b38f3e6505ef80480 [INFO] sha for GitHub repo GovTechSG/chkr: 767e4218499563f16683fc0b38f3e6505ef80480 [INFO] validating manifest of GovTechSG/chkr 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 GovTechSG/chkr 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 GovTechSG/chkr [INFO] finished frobbing GovTechSG/chkr [INFO] frobbed toml for GovTechSG/chkr written to work/ex/clippy-test-run/sources/stable/gh/GovTechSG/chkr/Cargo.toml [INFO] started frobbing GovTechSG/chkr [INFO] finished frobbing GovTechSG/chkr [INFO] frobbed toml for GovTechSG/chkr written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/GovTechSG/chkr/Cargo.toml [INFO] crate GovTechSG/chkr 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 GovTechSG/chkr against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-3/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/gh/GovTechSG/chkr:/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] 25177d6a5625720af832b7ea83ebf2ccc68fb4cef450781396afdf606201f8d6 [INFO] running `"docker" "start" "-a" "25177d6a5625720af832b7ea83ebf2ccc68fb4cef450781396afdf606201f8d6"` [INFO] [stderr] Checking csv v0.14.7 [INFO] [stderr] Checking docopt v0.6.86 [INFO] [stderr] Checking chkr v0.1.0 (/opt/crater/workdir) [INFO] [stderr] warning: Constants have by default a `'static` lifetime [INFO] [stderr] --> src/main.rs:18:15 [INFO] [stderr] | [INFO] [stderr] 18 | const USAGE: &'static str = r##" [INFO] [stderr] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::const_static_lifetime)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_static_lifetime [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/checksum.rs:80:46 [INFO] [stderr] | [INFO] [stderr] 80 | let file_buffer = read(path).map_err(|e| format!("{}", e))?; [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: consider using .to_string(): `e.to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_format)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: use of `ok_or` followed by a function call [INFO] [stderr] --> src/checksum.rs:98:10 [INFO] [stderr] | [INFO] [stderr] 98 | .ok_or("Unable to compute working directory".to_string())?; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| "Unable to compute working directory".to_string())` [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: use of `ok_or` followed by a function call [INFO] [stderr] --> src/checksum.rs:101:10 [INFO] [stderr] | [INFO] [stderr] 101 | .ok_or("Unable to convert paths".to_string())?; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| "Unable to convert paths".to_string())` [INFO] [stderr] | [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: casting u8 to i32 may become silently lossy if types change [INFO] [stderr] --> src/main.rs:69:24 [INFO] [stderr] | [INFO] [stderr] 69 | std::process::exit(exit_code as i32); [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: try: `i32::from(exit_code)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cast_lossless)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/main.rs:73:5 [INFO] [stderr] | [INFO] [stderr] 73 | / match args { [INFO] [stderr] 74 | | &Args { cmd_file: true, .. } => Some(file), [INFO] [stderr] 75 | | &Args { cmd_manifest: true, .. } => Some(manifest), [INFO] [stderr] 76 | | _ => None, [INFO] [stderr] 77 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_ref_pats)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 73 | match *args { [INFO] [stderr] 74 | Args { cmd_file: true, .. } => Some(file), [INFO] [stderr] 75 | Args { cmd_manifest: true, .. } => Some(manifest), [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:115:9 [INFO] [stderr] | [INFO] [stderr] 115 | i = i + 1; [INFO] [stderr] | ^^^^^^^^^ help: replace it with: `i += 1` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] warning: Constants have by default a `'static` lifetime [INFO] [stderr] --> src/main.rs:18:15 [INFO] [stderr] | [INFO] [stderr] 18 | const USAGE: &'static str = r##" [INFO] [stderr] | -^^^^^^^---- help: consider removing `'static`: `&str` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::const_static_lifetime)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#const_static_lifetime [INFO] [stderr] [INFO] [stderr] warning: useless use of `format!` [INFO] [stderr] --> src/checksum.rs:80:46 [INFO] [stderr] | [INFO] [stderr] 80 | let file_buffer = read(path).map_err(|e| format!("{}", e))?; [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: consider using .to_string(): `e.to_string()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::useless_format)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_format [INFO] [stderr] = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) [INFO] [stderr] [INFO] [stderr] warning: use of `ok_or` followed by a function call [INFO] [stderr] --> src/checksum.rs:98:10 [INFO] [stderr] | [INFO] [stderr] 98 | .ok_or("Unable to compute working directory".to_string())?; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| "Unable to compute working directory".to_string())` [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: use of `ok_or` followed by a function call [INFO] [stderr] --> src/checksum.rs:101:10 [INFO] [stderr] | [INFO] [stderr] 101 | .ok_or("Unable to convert paths".to_string())?; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `ok_or_else(|| "Unable to convert paths".to_string())` [INFO] [stderr] | [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: You are using an explicit closure for cloning elements [INFO] [stderr] --> src/checksum.rs:185:44 [INFO] [stderr] | [INFO] [stderr] 185 | let mut actual_keys: Vec = results.keys().map(|key| key.clone()).collect(); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: Consider calling the dedicated `cloned` method: `results.keys().cloned()` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::map_clone)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_clone [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/checksum.rs:191:25 [INFO] [stderr] | [INFO] [stderr] 191 | assert_matches!(results.get("foo.txt").unwrap(), &Ok(Outcome::Match)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&results["foo.txt"]` [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: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/checksum.rs:192:25 [INFO] [stderr] | [INFO] [stderr] 192 | assert_matches!(results.get("bar.txt").unwrap(), &Ok(Outcome::Mismatch{ .. })); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&results["bar.txt"]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap [INFO] [stderr] [INFO] [stderr] warning: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise [INFO] [stderr] --> src/checksum.rs:193:25 [INFO] [stderr] | [INFO] [stderr] 193 | assert_matches!(results.get("file-does-not-exist").unwrap(), &Err(_)); [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try this: `&results["file-does-not-exist"]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#get_unwrap [INFO] [stderr] [INFO] [stderr] warning: casting u8 to i32 may become silently lossy if types change [INFO] [stderr] --> src/main.rs:69:24 [INFO] [stderr] | [INFO] [stderr] 69 | std::process::exit(exit_code as i32); [INFO] [stderr] | ^^^^^^^^^^^^^^^^ help: try: `i32::from(exit_code)` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::cast_lossless)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: you don't need to add `&` to all patterns [INFO] [stderr] --> src/main.rs:73:5 [INFO] [stderr] | [INFO] [stderr] 73 | / match args { [INFO] [stderr] 74 | | &Args { cmd_file: true, .. } => Some(file), [INFO] [stderr] 75 | | &Args { cmd_manifest: true, .. } => Some(manifest), [INFO] [stderr] 76 | | _ => None, [INFO] [stderr] 77 | | } [INFO] [stderr] | |_____^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::match_ref_pats)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats [INFO] [stderr] help: instead of prefixing all patterns with `&`, you can dereference the expression [INFO] [stderr] | [INFO] [stderr] 73 | match *args { [INFO] [stderr] 74 | Args { cmd_file: true, .. } => Some(file), [INFO] [stderr] 75 | Args { cmd_manifest: true, .. } => Some(manifest), [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: manual implementation of an assign operation [INFO] [stderr] --> src/main.rs:115:9 [INFO] [stderr] | [INFO] [stderr] 115 | i = i + 1; [INFO] [stderr] | ^^^^^^^^^ help: replace it with: `i += 1` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::assign_op_pattern)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern [INFO] [stderr] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 5.23s [INFO] running `"docker" "inspect" "25177d6a5625720af832b7ea83ebf2ccc68fb4cef450781396afdf606201f8d6"` [INFO] running `"docker" "rm" "-f" "25177d6a5625720af832b7ea83ebf2ccc68fb4cef450781396afdf606201f8d6"` [INFO] [stdout] 25177d6a5625720af832b7ea83ebf2ccc68fb4cef450781396afdf606201f8d6