-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Tracking issue for invalid_reference_casting #124951
Comments
Doing some crater analysis by extracting crates that trip this lint in the crater runs for 1.79: #124770 then re-running those locally with a compiler that contains the above fixes. These are the GitHub crates which trip the lint in the crater run:
The crates encountered on crates.io are:
Of those, only these crates trip the lint in question on the latest compiler (
I've trimmed the diagnostics a bit and deduplicated them within crates. It's very common to find the same dodgy unsafe code copy-pasted around.
I think these are all buggy, because they are incorrectly detecting the backing allocation in @Urgau What do you think? |
I would tend to agree that all of those cases are incorrectly detecting the backing allocation. If your patch fixes those issues, go ahead, I'm find with stay with the strategy we have right now. |
…au,Nilstrieb Handle Deref expressions in invalid_reference_casting Similar to rust-lang#124908 See rust-lang#124951 for context; this PR fixes the last of the known false postiive cases with this lint that we encounter in Crater.
Rollup merge of rust-lang#124978 - saethlin:ref-casting_derefs, r=Urgau,Nilstrieb Handle Deref expressions in invalid_reference_casting Similar to rust-lang#124908 See rust-lang#124951 for context; this PR fixes the last of the known false postiive cases with this lint that we encounter in Crater.
Handle Deref expressions in invalid_reference_casting Similar to rust-lang/rust#124908 See rust-lang/rust#124951 for context; this PR fixes the last of the known false postiive cases with this lint that we encounter in Crater.
This is a tracking issue for the lint
invalid_reference_casting
, which was uplifted from Clippy'scast_ref_to_mut
lint in #111567.This lint is deny-by-default, i.e.
#![deny(invalid_reference_casting)]
.Status
This lint was uplifted directly from Clippy, but shortly after that a bug in the lint was reported: #124685. Currently we are working on eliminating all forms of this issue.
Steps
Open Questions
The lint currently hunts for an expression that represents the backing allocation, then if it encounters a pattern known to produce false positives, we punt on reporting that case. Should we invert the logic and be silent by default instead?
Implementation history
#111567
#124761
#124908
#124978
The text was updated successfully, but these errors were encountered: