Skip to content

sapemu: Broken sbc #698

sapemu: Broken sbc

sapemu: Broken sbc #698

GitHub Actions / clippy failed Sep 17, 2024 in 0s

clippy

8 errors, 1 warning

Details

Results

Message level Amount
Internal compiler error 0
Error 8
Warning 1
Note 0
Help 0

Versions

  • rustc 1.83.0-nightly (8d6b88b16 2024-09-11)
  • cargo 1.83.0-nightly (c1fa840a8 2024-08-29)
  • clippy 0.1.82 (8d6b88b 2024-09-11)

Annotations

Check failure on line 2028 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

literal out of range for `u16`

error: literal out of range for `u16`
    --> sapemu/src/smp/ops.rs:2028:61
     |
2028 |             cpu.psw.set(ProgramStatusWord::Carry, expanded_result >= 0x1_0000);
     |                                                                      ^^^^^^^^
     |
     = note: the literal `0x1_0000` (decimal `65536`) does not fit into the type `u16` and will become `0u16`
     = help: consider using the type `u32` instead
     = note: `#[deny(overflowing_literals)]` on by default

Check warning on line 2028 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

comparison is useless due to type limits

warning: comparison is useless due to type limits
    --> sapemu/src/smp/ops.rs:2028:42
     |
2028 |             cpu.psw.set(ProgramStatusWord::Carry, expanded_result >= 0x1_0000);
     |                                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `#[warn(unused_comparisons)]` on by default

Check failure on line 462 in sapemu/src/smp.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casts from `bool` to `u8` can be expressed infallibly using `From`

error: casts from `bool` to `u8` can be expressed infallibly using `From`
   --> sapemu/src/smp.rs:462:57
    |
462 |         let half_carry_result = (op1 & 0x0f) + (op2 & 0x0f) + self.carry() as u8 >= 0x10;
    |                                                               ^^^^^^^^^^^^^^^^^^
    |
    = help: an `as` cast can become silently lossy if the types change in the future
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_lossless
    = note: `-D clippy::cast-lossless` implied by `-D clippy::pedantic`
    = help: to override `-D clippy::pedantic` add `#[allow(clippy::cast_lossless)]`
help: use `u8::from` instead
    |
462 |         let half_carry_result = (op1 & 0x0f) + (op2 & 0x0f) + u8::from(self.carry()) >= 0x10;
    |                                                               ~~~~~~~~~~~~~~~~~~~~~~

Check failure on line 2026 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

because of the numeric bounds on `result` prior to casting, this expression is always false

error: because of the numeric bounds on `result` prior to casting, this expression is always false
    --> sapemu/src/smp/ops.rs:2026:41
     |
2026 |             cpu.psw.set(ProgramStatusWord::Sign, (result as i16) < 0);
     |                                                  ^^^^^^^^^^^^^^^^^^^
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#invalid_upcast_comparisons
     = note: `-D clippy::invalid-upcast-comparisons` implied by `-D clippy::pedantic`
     = help: to override `-D clippy::pedantic` add `#[allow(clippy::invalid_upcast_comparisons)]`

Check failure on line 1969 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

error: this operation has no effect
    --> sapemu/src/smp/ops.rs:1969:12
     |
1969 |             cpu.y = (modulus & 0xff) as u8;
     |                     ^^^^^^^^^^^^^^^^ help: consider reducing it to: `modulus`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check failure on line 1969 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u8` -> `u8`)

error: casting to the same type is unnecessary (`u8` -> `u8`)
    --> sapemu/src/smp/ops.rs:1969:12
     |
1969 |             cpu.y = (modulus & 0xff) as u8;
     |                     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `(modulus & 0xff)`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

Check failure on line 1968 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

error: this operation has no effect
    --> sapemu/src/smp/ops.rs:1968:12
     |
1968 |             cpu.a = (div & 0xff) as u8;
     |                     ^^^^^^^^^^^^ help: consider reducing it to: `div`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op

Check failure on line 1968 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

casting to the same type is unnecessary (`u8` -> `u8`)

error: casting to the same type is unnecessary (`u8` -> `u8`)
    --> sapemu/src/smp/ops.rs:1968:12
     |
1968 |             cpu.a = (div & 0xff) as u8;
     |                     ^^^^^^^^^^^^^^^^^^ help: try: `(div & 0xff)`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
     = note: `-D clippy::unnecessary-cast` implied by `-D clippy::all`
     = help: to override `-D clippy::all` add `#[allow(clippy::unnecessary_cast)]`

Check failure on line 1965 in sapemu/src/smp/ops.rs

See this annotation in the file changed.

@github-actions github-actions / clippy

this operation has no effect

error: this operation has no effect
    --> sapemu/src/smp/ops.rs:1965:42
     |
1965 |             cpu.psw.set(ProgramStatusWord::Sign, ((div & 0xff) as i8) < 0);
     |                                                   ^^^^^^^^^^^^ help: consider reducing it to: `div`
     |
     = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
     = note: `-D clippy::identity-op` implied by `-D clippy::all`
     = help: to override `-D clippy::all` add `#[allow(clippy::identity_op)]`