-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Invalid warning to cast raw pointer to the same type #11113
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
Comments
We should make it not automatically apply the suggestions in Linting here seems correct to me though since it is casting a |
That's what clippy seems to think as well but no, it's casting a This lets the us hop through to the implementation of a virtual function table. |
The cast |
Ah, that's very cool compiler flag. 😏 Thanks! So then the clippy suggestion is just slightly off as it doesn't work as suggested? |
Yeah the suggestion needs some human help to keep the type inference working in this case, so |
Thanks for the fix! 👍 |
Summary
This is a minimal repro from a new warning that popped up in windows-rs.
Lint Name
unnecessary_cast
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No warnings! 😉
And if you ask clippy to fix it then it blows up:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: