[INFO] updating cached repository jD91mZM2/crappy-chess-minimax [INFO] running `"git" "fetch" "--all"` [INFO] [stdout] Fetching origin [INFO] [stderr] From git://github.com/jD91mZM2/crappy-chess-minimax [INFO] [stderr] * branch HEAD -> FETCH_HEAD [INFO] running `"git" "clone" "work/cache/sources/gh/jD91mZM2/crappy-chess-minimax" "work/ex/clippy-test-run/sources/stable/gh/jD91mZM2/crappy-chess-minimax"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable/gh/jD91mZM2/crappy-chess-minimax'... [INFO] [stderr] done. [INFO] running `"git" "clone" "work/cache/sources/gh/jD91mZM2/crappy-chess-minimax" "work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/jD91mZM2/crappy-chess-minimax"` [INFO] [stderr] Cloning into 'work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/jD91mZM2/crappy-chess-minimax'... [INFO] [stderr] done. [INFO] running `"git" "rev-parse" "HEAD"` [INFO] [stdout] f0e29941b0cedfe95d2804cd64c83066b140ea92 [INFO] sha for GitHub repo jD91mZM2/crappy-chess-minimax: f0e29941b0cedfe95d2804cd64c83066b140ea92 [INFO] validating manifest of jD91mZM2/crappy-chess-minimax 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 jD91mZM2/crappy-chess-minimax 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 jD91mZM2/crappy-chess-minimax [INFO] finished frobbing jD91mZM2/crappy-chess-minimax [INFO] frobbed toml for jD91mZM2/crappy-chess-minimax written to work/ex/clippy-test-run/sources/stable/gh/jD91mZM2/crappy-chess-minimax/Cargo.toml [INFO] started frobbing jD91mZM2/crappy-chess-minimax [INFO] finished frobbing jD91mZM2/crappy-chess-minimax [INFO] frobbed toml for jD91mZM2/crappy-chess-minimax written to work/ex/clippy-test-run/sources/stable+rustflags=-Dclippy%3A%3Ainto_iter_on_array/gh/jD91mZM2/crappy-chess-minimax/Cargo.toml [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [INFO] running `"/mnt/big/crater/work/local/cargo-home/bin/cargo" "+stable" "generate-lockfile" "--manifest-path" "Cargo.toml" "-Zno-index-update"` [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 jD91mZM2/crappy-chess-minimax against stable for clippy-test-run [INFO] running `"docker" "create" "-v" "/mnt/big/crater/work/local/target-dirs/clippy-test-run/worker-5/stable:/opt/crater/target:rw,Z" "-v" "/mnt/big/crater/work/ex/clippy-test-run/sources/stable/gh/jD91mZM2/crappy-chess-minimax:/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] 6ff99592805ebc91a2f4e0da5610da65769180c21d9bdbabaa4287ce06e243e2 [INFO] running `"docker" "start" "-a" "6ff99592805ebc91a2f4e0da5610da65769180c21d9bdbabaa4287ce06e243e2"` [INFO] [stderr] Compiling libc v0.2.48 [INFO] [stderr] Compiling arrayvec v0.4.10 [INFO] [stderr] Checking backtrace-sys v0.1.28 [INFO] [stderr] Checking backtrace v0.3.13 [INFO] [stderr] Checking failure v0.1.5 [INFO] [stderr] Checking chess-minimax v0.1.0 (/opt/crater/workdir) [INFO] [stderr] warning: this if statement can be collapsed [INFO] [stderr] --> src/board.rs:275:28 [INFO] [stderr] | [INFO] [stderr] 275 | } else if from == Pos(WIDTH-1, row) { [INFO] [stderr] | ____________________________^ [INFO] [stderr] 276 | | if castling.kingside { [INFO] [stderr] 277 | | vec.push(Undo::Castling(piece.side, *castling)); [INFO] [stderr] 278 | | castling.kingside = false; [INFO] [stderr] 279 | | } [INFO] [stderr] 280 | | } [INFO] [stderr] | |_____________________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::collapsible_if)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 275 | } else if from == Pos(WIDTH-1, row) && castling.kingside { [INFO] [stderr] 276 | vec.push(Undo::Castling(piece.side, *castling)); [INFO] [stderr] 277 | castling.kingside = false; [INFO] [stderr] 278 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: this if statement can be collapsed [INFO] [stderr] --> src/board.rs:275:28 [INFO] [stderr] | [INFO] [stderr] 275 | } else if from == Pos(WIDTH-1, row) { [INFO] [stderr] | ____________________________^ [INFO] [stderr] 276 | | if castling.kingside { [INFO] [stderr] 277 | | vec.push(Undo::Castling(piece.side, *castling)); [INFO] [stderr] 278 | | castling.kingside = false; [INFO] [stderr] 279 | | } [INFO] [stderr] 280 | | } [INFO] [stderr] | |_____________________^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::collapsible_if)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_if [INFO] [stderr] help: try [INFO] [stderr] | [INFO] [stderr] 275 | } else if from == Pos(WIDTH-1, row) && castling.kingside { [INFO] [stderr] 276 | vec.push(Undo::Castling(piece.side, *castling)); [INFO] [stderr] 277 | castling.kingside = false; [INFO] [stderr] 278 | } [INFO] [stderr] | [INFO] [stderr] [INFO] [stderr] warning: casting u8 to i16 may become silently lossy if types change [INFO] [stderr] --> src/board.rs:349:22 [INFO] [stderr] | [INFO] [stderr] 349 | score += piece.kind.worth() as i16; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i16::from(piece.kind.worth())` [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: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name [INFO] [stderr] --> src/board.rs:374:25 [INFO] [stderr] | [INFO] [stderr] 374 | pub fn is_checkmate(&mut self, side: Side) -> bool { [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: casting u8 to i16 may become silently lossy if types change [INFO] [stderr] --> src/minimax.rs:37:55 [INFO] [stderr] | [INFO] [stderr] 37 | let game_over = if maximizing { 999 + depth as i16 } else { -999 - depth as i16 }; [INFO] [stderr] | ^^^^^^^^^^^^ help: try: `i16::from(depth)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting u8 to i16 may become silently lossy if types change [INFO] [stderr] --> src/minimax.rs:37:84 [INFO] [stderr] | [INFO] [stderr] 37 | let game_over = if maximizing { 999 + depth as i16 } else { -999 - depth as i16 }; [INFO] [stderr] | ^^^^^^^^^^^^ help: try: `i16::from(depth)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/piece.rs:31:20 [INFO] [stderr] | [INFO] [stderr] 31 | pub fn to_char(&self) -> char { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::trivially_copy_pass_by_ref)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/piece.rs:51:18 [INFO] [stderr] | [INFO] [stderr] 51 | pub fn moves(&self) -> (ArrayVec<[Pos; 10]>, bool) { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: the loop variable `y` is only used to index `pieces`. [INFO] [stderr] --> src/serialize.rs:55:14 [INFO] [stderr] | [INFO] [stderr] 55 | for y in 0..board::WIDTH as usize { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_range_loop)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 55 | for in pieces.iter_mut().take(board::WIDTH as usize) { [INFO] [stderr] | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/serialize.rs:93:33 [INFO] [stderr] | [INFO] [stderr] 93 | pub fn serialize_pieces(pieces: &[Option; 2]) -> u8 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `[Option; 2]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `pieces` [INFO] [stderr] --> src/serialize.rs:116:14 [INFO] [stderr] | [INFO] [stderr] 116 | for i in 0..2 { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 116 | for (i, ) in pieces.iter_mut().enumerate() { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: casting character literal to u8. `char`s are 4 bytes wide in rust, so casting to u8 truncates them [INFO] [stderr] --> src/lib.rs:69:28 [INFO] [stderr] | [INFO] [stderr] 69 | write!(f, "{}{}", ('A' as u8 + x as u8) as char, board::WIDTH-y) [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::char_lit_as_u8)] on by default [INFO] [stderr] = help: Consider using a byte literal instead: [INFO] [stderr] b'A' [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stderr] [INFO] [stderr] warning: casting u8 to i16 may become silently lossy if types change [INFO] [stderr] --> src/board.rs:349:22 [INFO] [stderr] | [INFO] [stderr] 349 | score += piece.kind.worth() as i16; [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `i16::from(piece.kind.worth())` [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: methods called `is_*` usually take self by reference or no self; consider choosing a less ambiguous name [INFO] [stderr] --> src/board.rs:374:25 [INFO] [stderr] | [INFO] [stderr] 374 | pub fn is_checkmate(&mut self, side: Side) -> bool { [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: casting u8 to i16 may become silently lossy if types change [INFO] [stderr] --> src/minimax.rs:37:55 [INFO] [stderr] | [INFO] [stderr] 37 | let game_over = if maximizing { 999 + depth as i16 } else { -999 - depth as i16 }; [INFO] [stderr] | ^^^^^^^^^^^^ help: try: `i16::from(depth)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: casting u8 to i16 may become silently lossy if types change [INFO] [stderr] --> src/minimax.rs:37:84 [INFO] [stderr] | [INFO] [stderr] 37 | let game_over = if maximizing { 999 + depth as i16 } else { -999 - depth as i16 }; [INFO] [stderr] | ^^^^^^^^^^^^ help: try: `i16::from(depth)` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/piece.rs:31:20 [INFO] [stderr] | [INFO] [stderr] 31 | pub fn to_char(&self) -> char { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::trivially_copy_pass_by_ref)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/piece.rs:51:18 [INFO] [stderr] | [INFO] [stderr] 51 | pub fn moves(&self) -> (ArrayVec<[Pos; 10]>, bool) { [INFO] [stderr] | ^^^^^ help: consider passing by value instead: `self` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: the loop variable `y` is only used to index `pieces`. [INFO] [stderr] --> src/serialize.rs:55:14 [INFO] [stderr] | [INFO] [stderr] 55 | for y in 0..board::WIDTH as usize { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::needless_range_loop)] on by default [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 55 | for in pieces.iter_mut().take(board::WIDTH as usize) { [INFO] [stderr] | ^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: this argument is passed by reference, but would be more efficient if passed by value [INFO] [stderr] --> src/serialize.rs:93:33 [INFO] [stderr] | [INFO] [stderr] 93 | pub fn serialize_pieces(pieces: &[Option; 2]) -> u8 { [INFO] [stderr] | ^^^^^^^^^^^^^^^^^^^ help: consider passing by value instead: `[Option; 2]` [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#trivially_copy_pass_by_ref [INFO] [stderr] [INFO] [stderr] warning: the loop variable `i` is used to index `pieces` [INFO] [stderr] --> src/serialize.rs:116:14 [INFO] [stderr] | [INFO] [stderr] 116 | for i in 0..2 { [INFO] [stderr] | ^^^^ [INFO] [stderr] | [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_range_loop [INFO] [stderr] help: consider using an iterator [INFO] [stderr] | [INFO] [stderr] 116 | for (i, ) in pieces.iter_mut().enumerate() { [INFO] [stderr] | ^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ [INFO] [stderr] [INFO] [stderr] warning: casting character literal to u8. `char`s are 4 bytes wide in rust, so casting to u8 truncates them [INFO] [stderr] --> src/lib.rs:69:28 [INFO] [stderr] | [INFO] [stderr] 69 | write!(f, "{}{}", ('A' as u8 + x as u8) as char, board::WIDTH-y) [INFO] [stderr] | ^^^^^^^^^ [INFO] [stderr] | [INFO] [stderr] = note: #[warn(clippy::char_lit_as_u8)] on by default [INFO] [stderr] = help: Consider using a byte literal instead: [INFO] [stderr] b'A' [INFO] [stderr] = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#char_lit_as_u8 [INFO] [stderr] [INFO] [stderr] Finished dev [unoptimized + debuginfo] target(s) in 7.71s [INFO] running `"docker" "inspect" "6ff99592805ebc91a2f4e0da5610da65769180c21d9bdbabaa4287ce06e243e2"` [INFO] running `"docker" "rm" "-f" "6ff99592805ebc91a2f4e0da5610da65769180c21d9bdbabaa4287ce06e243e2"` [INFO] [stdout] 6ff99592805ebc91a2f4e0da5610da65769180c21d9bdbabaa4287ce06e243e2