svd2rust
svd2rust copied to clipboard
Clippy `identity_op` warning in v0.33.3
Hi,
I recently updated my PAC for the VA108xx family and I receive following clippy warnings with the generated code:
va108xx-rs/va108xx on
main [!] is 📦 v0.3.0 via 🦀 v1.78.0
❯ cargo clippy
warning: this operation has no effect
--> va108xx/src/porta.rs:36:66
|
36 | unsafe { &*(self as *const Self).cast::<u8>().add(0).add(1 * n).cast() }
| ^^^^^ help: consider reducing it to: `n`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
= note: `#[warn(clippy::identity_op)]` on by default
warning: this operation has no effect
--> va108xx/src/porta.rs:43:84
|
43 | ...cast::<u8>().add(0).add(1 * n).cast() })
| ^^^^^ help: consider reducing it to: `n`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
warning: this operation has no effect
--> va108xx/src/porta.rs:55:66
|
55 | unsafe { &*(self as *const Self).cast::<u8>().add(4).add(1 * n).cast() }
| ^^^^^ help: consider reducing it to: `n`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
Manually inserting #![allow(clippy::identity_op)] can be used to fix the issue, but this is probably something that can be fixed at the code-generation stage?