Skip to content
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

New lint: NOP pointer arithmetic #4813

Closed
CAD97 opened this issue Nov 14, 2019 · 0 comments · Fixed by #4816
Closed

New lint: NOP pointer arithmetic #4813

CAD97 opened this issue Nov 14, 2019 · 0 comments · Fixed by #4816
Labels
A-lint Area: New lints

Comments

@CAD97
Copy link
Contributor

CAD97 commented Nov 14, 2019

(I'm not sure if clippy has enough information for this, but it would've caught a big error I just fixed.)

Clippy should lint on the use of <*[const|mut] T>::offset, wrapping_offset, add, wrapping_add, sub, and wrapping_sub where T has size 0. This is a NOP and likely unintended.

@JohnTitor JohnTitor added the A-lint Area: New lints label Nov 14, 2019
bors added a commit that referenced this issue Nov 23, 2019
New lint: zst_offset

This fixes #4813

changelog: add `zst_offset` lint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-lint Area: New lints
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants