Skip to content

chore: Fix the lint warnings #401

chore: Fix the lint warnings

chore: Fix the lint warnings #401

Triggered via push May 21, 2024 04:47
Status Success
Total duration 1m 28s
Artifacts

build.yml

on: push
Matrix: Test Suite
Fit to window
Zoom out
Zoom in

Annotations

172 warnings
Test Suite (ubuntu-latest, stable, false)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite (ubuntu-latest, stable, false)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite (ubuntu-latest, stable, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, stable, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, stable, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, stable, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, stable, false): src/chess/position.rs#L49
type `Board` is more private than the item `position::Position::board`
Test Suite (ubuntu-latest, stable, false): src/evaluation/material.rs#L3
constant `PAWN_VALUE` is never used
Test Suite (ubuntu-latest, stable, false): src/evaluation/material.rs#L4
constant `KNIGHT_VALUE` is never used
Test Suite (ubuntu-latest, stable, false): src/evaluation/material.rs#L5
constant `BISHOP_VALUE` is never used
Test Suite (ubuntu-latest, stable, false): src/evaluation/material.rs#L6
constant `ROOK_VALUE` is never used
Test Suite (ubuntu-latest, stable, false): src/evaluation/material.rs#L7
constant `QUEEN_VALUE` is never used
Test Suite (ubuntu-latest, stable, false): src/evaluation/material.rs#L9
function `material_advantage` is never used
Test Suite (macos-latest, stable, true)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite (macos-latest, stable, true)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite (macos-latest, stable, true): src/evaluation/material.rs#L9
unused variable: `position`
Test Suite (macos-latest, stable, true): src/chess/position.rs#L49
type `Board` is more private than the item `position::Position::board`
Test Suite (macos-latest, stable, true): src/evaluation/material.rs#L3
constant `PAWN_VALUE` is never used
Test Suite (macos-latest, stable, true): src/evaluation/material.rs#L4
constant `KNIGHT_VALUE` is never used
Test Suite (macos-latest, stable, true): src/evaluation/material.rs#L5
constant `BISHOP_VALUE` is never used
Test Suite (macos-latest, stable, true): src/evaluation/material.rs#L6
constant `ROOK_VALUE` is never used
Test Suite (macos-latest, stable, true): src/evaluation/material.rs#L7
constant `QUEEN_VALUE` is never used
Test Suite (macos-latest, stable, true): src/evaluation/material.rs#L9
function `material_advantage` is never used
Test Suite (macos-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (macos-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (macos-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (macos-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, nightly, true)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite (ubuntu-latest, nightly, true)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite (ubuntu-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, nightly, true): src/chess/position.rs#L49
type `Board` is more private than the item `position::Position::board`
Test Suite (ubuntu-latest, nightly, true): src/evaluation/material.rs#L3
constant `PAWN_VALUE` is never used
Test Suite (ubuntu-latest, nightly, true): src/evaluation/material.rs#L4
constant `KNIGHT_VALUE` is never used
Test Suite (ubuntu-latest, nightly, true): src/evaluation/material.rs#L5
constant `BISHOP_VALUE` is never used
Test Suite (ubuntu-latest, nightly, true): src/evaluation/material.rs#L6
constant `ROOK_VALUE` is never used
Test Suite (ubuntu-latest, nightly, true): src/evaluation/material.rs#L7
constant `QUEEN_VALUE` is never used
Test Suite (ubuntu-latest, nightly, true): src/evaluation/material.rs#L9
function `material_advantage` is never used
Test Suite (ubuntu-latest, 1.78.0, false)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite (ubuntu-latest, 1.78.0, false)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite (ubuntu-latest, 1.78.0, false): src/chess/position.rs#L49
type `Board` is more private than the item `position::Position::board`
Test Suite (ubuntu-latest, 1.78.0, false): src/evaluation/material.rs#L3
constant `PAWN_VALUE` is never used
Test Suite (ubuntu-latest, 1.78.0, false): src/evaluation/material.rs#L4
constant `KNIGHT_VALUE` is never used
Test Suite (ubuntu-latest, 1.78.0, false): src/evaluation/material.rs#L5
constant `BISHOP_VALUE` is never used
Test Suite (ubuntu-latest, 1.78.0, false): src/evaluation/material.rs#L6
constant `ROOK_VALUE` is never used
Test Suite (ubuntu-latest, 1.78.0, false): src/evaluation/material.rs#L7
constant `QUEEN_VALUE` is never used
Test Suite (ubuntu-latest, 1.78.0, false): src/evaluation/material.rs#L9
function `material_advantage` is never used
Test Suite (ubuntu-latest, 1.78.0, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, 1.78.0, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, 1.78.0, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (ubuntu-latest, 1.78.0, false)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (macos-latest, nightly, true)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite (macos-latest, nightly, true)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite (macos-latest, nightly, true): src/chess/position.rs#L49
type `Board` is more private than the item `position::Position::board`
Test Suite (macos-latest, nightly, true): src/evaluation/material.rs#L3
constant `PAWN_VALUE` is never used
Test Suite (macos-latest, nightly, true): src/evaluation/material.rs#L4
constant `KNIGHT_VALUE` is never used
Test Suite (macos-latest, nightly, true): src/evaluation/material.rs#L5
constant `BISHOP_VALUE` is never used
Test Suite (macos-latest, nightly, true): src/evaluation/material.rs#L6
constant `ROOK_VALUE` is never used
Test Suite (macos-latest, nightly, true): src/evaluation/material.rs#L7
constant `QUEEN_VALUE` is never used
Test Suite (macos-latest, nightly, true): src/evaluation/material.rs#L9
function `material_advantage` is never used
Test Suite (macos-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (macos-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (macos-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (macos-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
missing documentation for a method: src/chess/position.rs#L415
warning: missing documentation for a method --> src/chess/position.rs:415:5 | 415 | pub fn make_move(&mut self, next_move: &Move) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/chess/position.rs#L275
warning: missing documentation for a method --> src/chess/position.rs:275:5 | 275 | pub fn is_legal(&self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/chess/position.rs#L270
warning: missing documentation for a method --> src/chess/position.rs:270:5 | 270 | pub fn has_insufficient_material(&self) -> bool { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a method: src/chess/core.rs#L132
warning: missing documentation for a method --> src/chess/core.rs:132:5 | 132 | pub fn shift(self, direction: Direction) -> Option<Self> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for an associated function: src/chess/core.rs#L49
warning: missing documentation for an associated function --> src/chess/core.rs:49:5 | 49 | pub fn from_san(_position: &Position) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for an associated function: src/chess/core.rs#L40
warning: missing documentation for an associated function --> src/chess/core.rs:40:5 | 40 | pub const fn new(from: Square, to: Square, promotion: Option<Promotion>) -> Self { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
missing documentation for a module: src/lib.rs#L54
warning: missing documentation for a module --> src/lib.rs:54:1 | 54 | pub mod search; | ^^^^^^^^^^^^^^
missing documentation for a module: src/lib.rs#L53
warning: missing documentation for a module --> src/lib.rs:53:1 | 53 | pub mod evaluation; | ^^^^^^^^^^^^^^^^^^
missing documentation for a module: src/lib.rs#L52
warning: missing documentation for a module --> src/lib.rs:52:1 | 52 | pub mod engine; | ^^^^^^^^^^^^^^ | note: the lint level is defined here --> src/lib.rs:11:9 | 11 | #![warn(missing_docs, variant_size_differences)] | ^^^^^^^^^^^^
variables can be used directly in the `format!` string: src/interface/uci.rs#L184
warning: variables can be used directly in the `format!` string --> src/interface/uci.rs:184:17 | 184 | writeln!(output, "Unknown command: {}", line).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 184 - writeln!(output, "Unknown command: {}", line).unwrap(); 184 + writeln!(output, "Unknown command: {line}").unwrap(); |
docs for function which may panic missing `# Panics` section: src/interface/uci.rs#L21
warning: docs for function which may panic missing `# Panics` section --> src/interface/uci.rs:21:1 | 21 | pub fn run_loop(input: &mut impl BufRead, output: &mut impl Write) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/interface/uci.rs:29:23 | 29 | Err(e) => panic!("Error reading from input: {}", e), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
this could be a `const fn`: src/evaluation/material.rs#L9
warning: this could be a `const fn` --> src/evaluation/material.rs:9:1 | 9 | / fn material_advantage(position: &Position) -> f32 { 10 | | 0. 11 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
this function has too many arguments (13/7): src/chess/position.rs#L776
warning: this function has too many arguments (13/7) --> src/chess/position.rs:776:1 | 776 | / fn generate_pawn_moves( 777 | | pawns: Bitboard, 778 | | us: Player, 779 | | they: Player, ... | 789 | | moves: &mut MoveList, 790 | | ) { | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments note: the lint level is defined here --> src/lib.rs:42:5 | 42 | clippy::complexity, | ^^^^^^^^^^^^^^^^^^ = note: `#[warn(clippy::too_many_arguments)]` implied by `#[warn(clippy::complexity)]`
docs for function which may panic missing `# Panics` section: src/chess/position.rs#L415
warning: docs for function which may panic missing `# Panics` section --> src/chess/position.rs:415:5 | 415 | pub fn make_move(&mut self, next_move: &Move) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: first possible panic found here --> src/chess/position.rs:477:38 | 477 | let single_push_square = next_move.from.shift(us.push_direction()).unwrap(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc = note: `#[warn(clippy::missing_panics_doc)]` implied by `#[warn(clippy::pedantic)]`
this could be rewritten as `let...else`: src/chess/position.rs#L153
warning: this could be rewritten as `let...else` --> src/chess/position.rs:153:9 | 153 | / let pieces_placement = match parts.next() { 154 | | Some(placement) => placement, 155 | | None => bail!("incorrect FEN: missing pieces placement"), 156 | | }; | |__________^ help: consider writing: `let Some(pieces_placement) = parts.next() else { bail!("incorrect FEN: missing pieces placement") };` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else
this function has too many lines (107/100): src/chess/position.rs#L149
warning: this function has too many lines (107/100) --> src/chess/position.rs:149:5 | 149 | / pub fn from_fen(input: &str) -> anyhow::Result<Self> { 150 | | let mut parts = input.split(' '); 151 | | // Parse Piece Placement. 152 | | let mut result = Self::empty(); ... | 260 | | } 261 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_lines = note: `#[warn(clippy::too_many_lines)]` implied by `#[warn(clippy::pedantic)]`
docs for function returning `Result` missing `# Errors` section: src/chess/position.rs#L149
warning: docs for function returning `Result` missing `# Errors` section --> src/chess/position.rs:149:5 | 149 | pub fn from_fen(input: &str) -> anyhow::Result<Self> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_errors_doc = note: `#[warn(clippy::missing_errors_doc)]` implied by `#[warn(clippy::pedantic)]`
this could be a `const fn`: src/chess/position.rs#L102
warning: this could be a `const fn` --> src/chess/position.rs:102:5 | 102 | / pub(super) fn they(&self) -> Player { 103 | | self.us().opponent() 104 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
you are deriving `PartialEq` and can implement `Eq`: src/chess/core.rs#L632
warning: you are deriving `PartialEq` and can implement `Eq` --> src/chess/core.rs:632:30 | 632 | #[derive(Clone, Copy, Debug, PartialEq, PartialOrd)] | ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq
you are deriving `PartialEq` and can implement `Eq`: src/chess/core.rs#L383
warning: you are deriving `PartialEq` and can implement `Eq` --> src/chess/core.rs:383:30 | 383 | #[derive(Clone, Copy, Debug, PartialEq, PartialOrd)] | ^^^^^^^^^ help: consider deriving `Eq` as well: `PartialEq, Eq` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq = note: `#[warn(clippy::derive_partial_eq_without_eq)]` implied by `#[warn(clippy::nursery)]`
transmute used without annotations: src/chess/core.rs#L315
warning: transmute used without annotations --> src/chess/core.rs:315:39 | 315 | 0..=7 => Ok(unsafe { mem::transmute(row) }), | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u8, chess::core::Rank>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
transmute used without annotations: src/chess/core.rs#L304
warning: transmute used without annotations --> src/chess/core.rs:304:43 | 304 | '1'..='8' => Ok(unsafe { mem::transmute(rank as u8 - b'1') }), | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u8, chess::core::Rank>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
transmute used without annotations: src/chess/core.rs#L245
warning: transmute used without annotations --> src/chess/core.rs:245:39 | 245 | 0..=7 => Ok(unsafe { mem::transmute(column) }), | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u8, chess::core::File>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
transmute used without annotations: src/chess/core.rs#L234
warning: transmute used without annotations --> src/chess/core.rs:234:43 | 234 | 'a'..='h' => Ok(unsafe { mem::transmute(file as u8 - b'a') }), | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u8, chess::core::File>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
this could be rewritten as `let...else`: src/chess/core.rs#L187
warning: this could be rewritten as `let...else` --> src/chess/core.rs:187:9 | 187 | / let (file, rank) = match square.chars().collect_tuple() { 188 | | Some((file, rank)) => (file, rank), 189 | | None => bail!( 190 | | "square should be two-char, got {square} with {} chars", 191 | | square.bytes().len() 192 | | ), 193 | | }; | |__________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_let_else = note: `#[warn(clippy::manual_let_else)]` implied by `#[warn(clippy::pedantic)]` help: consider writing | 187 ~ let Some((file, rank)) = square.chars().collect_tuple() else { bail!( 188 + "square should be two-char, got {square} with {} chars", 189 + square.bytes().len() 190 + ) }; |
transmute used without annotations: src/chess/core.rs#L177
warning: transmute used without annotations --> src/chess/core.rs:177:47 | 177 | 0..=MAX_INDEX => Ok(unsafe { mem::transmute(square_index) }), | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<i8, chess::core::Square>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
casting `u8` to `i8` may wrap around the value: src/chess/core.rs#L175
warning: casting `u8` to `i8` may wrap around the value --> src/chess/core.rs:175:31 | 175 | const MAX_INDEX: i8 = BOARD_SIZE as i8 - 1; | ^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
transmute used without annotations: src/chess/core.rs#L158
warning: transmute used without annotations --> src/chess/core.rs:158:47 | 158 | 0..=MAX_INDEX => Ok(unsafe { mem::transmute(square_index) }), | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u8, chess::core::Square>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
use Option::map_or instead of an if let/else: src/chess/core.rs#L138
warning: use Option::map_or instead of an if let/else --> src/chess/core.rs:138:9 | 138 | / match Self::try_from(self as i8 + shift) { 139 | | Ok(square) => Some(square), 140 | | Err(_) => None, 141 | | } | |_________^ help: try: `Self::try_from(self as i8 + shift).map_or(None, |square| Some(square))` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_if_let_else = note: `#[warn(clippy::option_if_let_else)]` implied by `#[warn(clippy::nursery)]`
casting `u8` to `i8` may wrap around the value: src/chess/core.rs#L135
warning: casting `u8` to `i8` may wrap around the value --> src/chess/core.rs:135:33 | 135 | Direction::Down => -(BOARD_WIDTH as i8), | ^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap
casting `u8` to `i8` may wrap around the value: src/chess/core.rs#L134
warning: casting `u8` to `i8` may wrap around the value --> src/chess/core.rs:134:30 | 134 | Direction::Up => BOARD_WIDTH as i8, | ^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_wrap = note: `#[warn(clippy::cast_possible_wrap)]` implied by `#[warn(clippy::pedantic)]`
variables can be used directly in the `format!` string: src/chess/bitboard.rs#L523
warning: variables can be used directly in the `format!` string --> src/chess/bitboard.rs:523:17 | 523 | write!(f, "{}", LINE_SEPARATOR)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 523 - write!(f, "{}", LINE_SEPARATOR)?; 523 + write!(f, "{LINE_SEPARATOR}")?; |
variables can be used directly in the `format!` string: src/chess/bitboard.rs#L519
warning: variables can be used directly in the `format!` string --> src/chess/bitboard.rs:519:21 | 519 | write!(f, "{}", SQUARE_SEPARATOR)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args help: change this to | 519 - write!(f, "{}", SQUARE_SEPARATOR)?; 519 + write!(f, "{SQUARE_SEPARATOR}")?; |
variables can be used directly in the `format!` string: src/chess/bitboard.rs#L489
warning: variables can be used directly in the `format!` string --> src/chess/bitboard.rs:489:21 | 489 | write!(f, "{}", piece)?; | ^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args = note: `#[warn(clippy::uninlined_format_args)]` implied by `#[warn(clippy::pedantic)]` help: change this to | 489 - write!(f, "{}", piece)?; 489 + write!(f, "{piece}")?; |
this could be a `const fn`: src/chess/bitboard.rs#L447
warning: this could be a `const fn` --> src/chess/bitboard.rs:447:5 | 447 | / pub(super) fn player_pieces(&self, player: Player) -> &Pieces { 448 | | match player { 449 | | Player::White => &self.white_pieces, 450 | | Player::Black => &self.black_pieces, 451 | | } 452 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
this could be a `const fn`: src/chess/bitboard.rs#L439
warning: this could be a `const fn` --> src/chess/bitboard.rs:439:5 | 439 | / pub(super) fn empty() -> Self { 440 | | Self { 441 | | white_pieces: Pieces::empty(), 442 | | black_pieces: Pieces::empty(), 443 | | } 444 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
casting `u32` to `u8` may truncate the value: src/chess/bitboard.rs#L296
warning: casting `u32` to `u8` may truncate the value --> src/chess/bitboard.rs:296:36 | 296 | Ok(unsafe { mem::transmute(self.bits.trailing_zeros() as u8) }) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation help: ... or use `try_from` and handle the error accordingly | 296 | Ok(unsafe { mem::transmute(u8::try_from(self.bits.trailing_zeros())) }) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
transmute used without annotations: src/chess/bitboard.rs#L296
warning: transmute used without annotations --> src/chess/bitboard.rs:296:26 | 296 | Ok(unsafe { mem::transmute(self.bits.trailing_zeros() as u8) }) | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u8, chess::core::Square>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations
casting `u32` to `u8` may truncate the value: src/chess/bitboard.rs#L276
warning: casting `u32` to `u8` may truncate the value --> src/chess/bitboard.rs:276:38 | 276 | Some(unsafe { mem::transmute(next_index as u8) }) | ^^^^^^^^^^^^^^^^ | = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation help: ... or use `try_from` and handle the error accordingly | 276 | Some(unsafe { mem::transmute(u8::try_from(next_index)) }) | ~~~~~~~~~~~~~~~~~~~~~~~~
transmute used without annotations: src/chess/bitboard.rs#L276
warning: transmute used without annotations --> src/chess/bitboard.rs:276:28 | 276 | Some(unsafe { mem::transmute(next_index as u8) }) | ^^^^^^^^^ help: consider adding missing annotations: `transmute::<u8, chess::core::Square>` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_transmute_annotations note: the lint level is defined here --> src/lib.rs:40:5 | 40 | clippy::suspicious, | ^^^^^^^^^^^^^^^^^^ = note: `#[warn(clippy::missing_transmute_annotations)]` implied by `#[warn(clippy::suspicious)]`
consider adding a `;` to the last statement for consistent formatting: src/chess/bitboard.rs#L208
warning: consider adding a `;` to the last statement for consistent formatting --> src/chess/bitboard.rs:208:9 | 208 | self.bitand_assign(!rhs) | ^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.bitand_assign(!rhs);` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned
consider adding a `;` to the last statement for consistent formatting: src/chess/bitboard.rs#L183
warning: consider adding a `;` to the last statement for consistent formatting --> src/chess/bitboard.rs:183:9 | 183 | self.bits.bitand_assign(rhs.bits) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `self.bits.bitand_assign(rhs.bits);` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#semicolon_if_nothing_returned = note: `#[warn(clippy::semicolon_if_nothing_returned)]` implied by `#[warn(clippy::pedantic)]`
this could be a `const fn`: src/chess/bitboard.rs#L127
warning: this could be a `const fn` --> src/chess/bitboard.rs:127:5 | 127 | / pub(super) fn iter(self) -> BitboardIterator { 128 | | BitboardIterator { bits: self.bits } 129 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
this could be a `const fn`: src/chess/bitboard.rs#L108
warning: this could be a `const fn` --> src/chess/bitboard.rs:108:5 | 108 | / pub(super) fn is_empty(self) -> bool { 109 | | self.bits == 0 110 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
this could be a `const fn`: src/chess/bitboard.rs#L103
warning: this could be a `const fn` --> src/chess/bitboard.rs:103:5 | 103 | / pub(super) fn count(self) -> u32 { 104 | | self.bits.count_ones() 105 | | } | |_____^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
casting `u32` to `u8` may truncate the value: src/chess/bitboard.rs#L99
warning: casting `u32` to `u8` may truncate the value --> src/chess/bitboard.rs:99:33 | 99 | unsafe { mem::transmute(self.bits.trailing_zeros() as u8) } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation help: ... or use `try_from` and handle the error accordingly | 99 | unsafe { mem::transmute(u8::try_from(self.bits.trailing_zeros())) } | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers: src/chess/attacks.rs#L25
warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers --> src/chess/attacks.rs:25:11 | 25 | + pext(occupancy.bits(), BISHOP_RELEVANT_OCCUPANCIES[from as usize]) as usize] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation help: ... or use `try_from` and handle the error accordingly | 25 | + usize::try_from(pext(occupancy.bits(), BISHOP_RELEVANT_OCCUPANCIES[from as usize]))] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers: src/chess/attacks.rs#L20
warning: casting `u64` to `usize` may truncate the value on targets with 32-bit wide pointers --> src/chess/attacks.rs:20:11 | 20 | + pext(occupancy.bits(), ROOK_RELEVANT_OCCUPANCIES[from as usize]) as usize] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: if this is intentional allow the lint with `#[allow(clippy::cast_possible_truncation)]` ... = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_possible_truncation note: the lint level is defined here --> src/lib.rs:43:5 | 43 | clippy::pedantic, | ^^^^^^^^^^^^^^^^ = note: `#[warn(clippy::cast_possible_truncation)]` implied by `#[warn(clippy::pedantic)]` help: ... or use `try_from` and handle the error accordingly | 20 | + usize::try_from(pext(occupancy.bits(), ROOK_RELEVANT_OCCUPANCIES[from as usize]))] | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this function may allocate 820364 bytes on the stack: src/chess/attacks.rs#L18
warning: this function may allocate 820364 bytes on the stack --> src/chess/attacks.rs:18:15 | 18 | pub(super) fn rook_attacks(from: Square, occupancy: Bitboard) -> Bitboard { | ^^^^^^^^^^^^ 19 | ROOK_ATTACKS[ROOK_ATTACK_OFFSETS[from as usize] | ------------ `ROOK_ATTACKS` is the largest part, at 819200 bytes for type `[chess::bitboard::Bitboard; 102400]` | = note: 820364 bytes is larger than Clippy's configured `stack-size-threshold` of 512000 = note: allocating large amounts of stack space can overflow the stack and cause the program to abort = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_stack_frames = note: `#[warn(clippy::large_stack_frames)]` implied by `#[warn(clippy::nursery)]`
this could be a `const fn`: src/chess/attacks.rs#L10
warning: this could be a `const fn` --> src/chess/attacks.rs:10:1 | 10 | / pub(super) fn king_attacks(from: Square) -> Bitboard { 11 | | KING_ATTACKS[from as usize] 12 | | } | |_^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn note: the lint level is defined here --> src/lib.rs:44:5 | 44 | clippy::nursery, | ^^^^^^^^^^^^^^^ = note: `#[warn(clippy::missing_const_for_fn)]` implied by `#[warn(clippy::nursery)]`
function `material_advantage` is never used: src/evaluation/material.rs#L9
warning: function `material_advantage` is never used --> src/evaluation/material.rs:9:4 | 9 | fn material_advantage(position: &Position) -> f32 { | ^^^^^^^^^^^^^^^^^^
constant `QUEEN_VALUE` is never used: src/evaluation/material.rs#L7
warning: constant `QUEEN_VALUE` is never used --> src/evaluation/material.rs:7:7 | 7 | const QUEEN_VALUE: f32 = 9.; | ^^^^^^^^^^^
constant `ROOK_VALUE` is never used: src/evaluation/material.rs#L6
warning: constant `ROOK_VALUE` is never used --> src/evaluation/material.rs:6:7 | 6 | const ROOK_VALUE: f32 = 5.; | ^^^^^^^^^^
constant `BISHOP_VALUE` is never used: src/evaluation/material.rs#L5
warning: constant `BISHOP_VALUE` is never used --> src/evaluation/material.rs:5:7 | 5 | const BISHOP_VALUE: f32 = 3.; | ^^^^^^^^^^^^
constant `KNIGHT_VALUE` is never used: src/evaluation/material.rs#L4
warning: constant `KNIGHT_VALUE` is never used --> src/evaluation/material.rs:4:7 | 4 | const KNIGHT_VALUE: f32 = 3.; | ^^^^^^^^^^^^
constant `PAWN_VALUE` is never used: src/evaluation/material.rs#L3
warning: constant `PAWN_VALUE` is never used --> src/evaluation/material.rs:3:7 | 3 | const PAWN_VALUE: f32 = 1.; | ^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
type `chess::bitboard::Board` is more private than the item `chess::position::Position::board`: src/chess/position.rs#L49
warning: type `chess::bitboard::Board` is more private than the item `chess::position::Position::board` --> src/chess/position.rs:49:5 | 49 | pub(crate) board: Board, | ^^^^^^^^^^^^^^^^^^^^^^^ field `chess::position::Position::board` is reachable at visibility `pub(crate)` | note: but type `chess::bitboard::Board` is only usable at visibility `pub(chess)` --> src/chess/bitboard.rs:423:1 | 423 | pub(super) struct Board { | ^^^^^^^^^^^^^^^^^^^^^^^ = note: `#[warn(private_interfaces)]` on by default
unused variable: `token`: src/interface/uci.rs#L153
warning: unused variable: `token` --> src/interface/uci.rs:153:25 | 153 | for token in tokens.iter().skip(3) { | ^^^^^ help: if this is intentional, prefix it with an underscore: `_token`
unused variable: `position`: src/evaluation/material.rs#L9
warning: unused variable: `position` --> src/evaluation/material.rs:9:23 | 9 | fn material_advantage(position: &Position) -> f32 { | ^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_position` | = note: `#[warn(unused_variables)]` on by default
unreachable expression: src/interface/uci.rs#L151
warning: unreachable expression --> src/interface/uci.rs:151:17 | 146 | todo!(); | ------- any code following this expression is unreachable ... 151 | / if tokens.len() > 2 && tokens[2] == "moves" { 152 | | // Handle moves 153 | | for token in tokens.iter().skip(3) { 154 | | // Process the move 155 | | todo!(); 156 | | } 157 | | } | |_________________^ unreachable expression | = note: `#[warn(unreachable_code)]` on by default
Test Suite (windows-latest, nightly, true)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite (windows-latest, nightly, true)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite (windows-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, nightly, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, nightly, true): src/chess/position.rs#L49
type `Board` is more private than the item `position::Position::board`
Test Suite (windows-latest, nightly, true): src/evaluation/material.rs#L3
constant `PAWN_VALUE` is never used
Test Suite (windows-latest, nightly, true): src/evaluation/material.rs#L4
constant `KNIGHT_VALUE` is never used
Test Suite (windows-latest, nightly, true): src/evaluation/material.rs#L5
constant `BISHOP_VALUE` is never used
Test Suite (windows-latest, nightly, true): src/evaluation/material.rs#L6
constant `ROOK_VALUE` is never used
Test Suite (windows-latest, nightly, true): src/evaluation/material.rs#L7
constant `QUEEN_VALUE` is never used
Test Suite (windows-latest, nightly, true): src/evaluation/material.rs#L9
function `material_advantage` is never used
Test Suite (windows-latest, stable, true)
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
Test Suite (windows-latest, stable, true)
The following actions uses node12 which is deprecated and will be forced to run on node16: actions-rs/toolchain@v1, actions-rs/cargo@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/
Test Suite (windows-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, stable, true)
The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Test Suite (windows-latest, stable, true): src/chess/position.rs#L49
type `Board` is more private than the item `position::Position::board`
Test Suite (windows-latest, stable, true): src/evaluation/material.rs#L3
constant `PAWN_VALUE` is never used
Test Suite (windows-latest, stable, true): src/evaluation/material.rs#L4
constant `KNIGHT_VALUE` is never used
Test Suite (windows-latest, stable, true): src/evaluation/material.rs#L5
constant `BISHOP_VALUE` is never used
Test Suite (windows-latest, stable, true): src/evaluation/material.rs#L6
constant `ROOK_VALUE` is never used
Test Suite (windows-latest, stable, true): src/evaluation/material.rs#L7
constant `QUEEN_VALUE` is never used
Test Suite (windows-latest, stable, true): src/evaluation/material.rs#L9
function `material_advantage` is never used