sapemu: Why is dividing so hard? #697
clippy
6 errors
Details
Results
Message level | Amount |
---|---|
Internal compiler error | 0 |
Error | 6 |
Warning | 0 |
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 462 in sapemu/src/smp.rs
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 1969 in sapemu/src/smp/ops.rs
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
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
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
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
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)]`