-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add new lint as_ptr_cast_underscore
#10782
Conversation
r? @giraffate (rustbot has picked a reviewer for you, use r? to override) |
This feels like it should be rolled into |
Potentially, though e: |
My lint #10567 checks for all uses of Because this case is specifically for not changing the types, it is likely more suspicious, liable for the types to change due to type inference, and especially with pointers, that's probably not desirable, so I think that it should be something that's warn by default, but I understand that it may be very common. I think that it would be useful for There's some times when I think that we should consider moving the |
If this is the general consensus, then I'm open to doing this if an accurate suggestion could be added (which one definitely could), so running
There's actually already |
Sorry for not being clear, I specifically mean that
|
☔ The latest upstream changes (presumably #10810) made this pull request unmergeable. Please resolve the merge conflicts. |
I'll close this and instead add this to |
This will lint when the result of
as *<constness> _
is both the same type and mutability, as it is an unnecessary operation.Fixes #10587
changelog: new lint [
as_ptr_cast_underscore
]