Skip to content

Clippy identity_op warning in v0.33.3 #854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
robamu opened this issue Jun 25, 2024 · 0 comments · Fixed by #871
Closed

Clippy identity_op warning in v0.33.3 #854

robamu opened this issue Jun 25, 2024 · 0 comments · Fixed by #871

Comments

@robamu
Copy link
Contributor

robamu commented Jun 25, 2024

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?

@robamu robamu changed the title Clippy identity_op warning when using v0.33.3 Clippy identity_op warning in v0.33.3 Jun 25, 2024
@burrbull burrbull mentioned this issue Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant