-
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
Thoroughly investigate transmute_undefined_repr #8496
Comments
Ran this lint the top 1000 (more or less) crates from crates.io. Here are the warnings I found. I'm unable to say which are false positives. Hope this helps.
Full warnings
|
The criterion error seems to indicate that the lint fails to apply type adjustments – in this case from |
sounds like we should at the very least be using the inferred or provided generic arguments of |
I opened #8501 to track this. |
Just went through all them.
For both
|
With the recent changes both
|
Results on running on more crates https://gist.github.com/Jarcho/6890efe9c9f051aef943f1dedbbbb02d True positives*vsdb-0.45.2: Transmute between different False positives*parity-scale-codec-3.1.5: Type parameter -> concrete type Most of those are related to fat pointer layouts, which as far as I know are still formally undefined. The Unsafe Code Guidelines Working Group has them defined well enough for most of these transmutes, but should that be considered enough to ignore these cases? |
See discussion in #8432
The lint is currently in the nursery and has had multiple problems in the past. We should do a deeper investigation: probably running it on a lot of crates and looking for false positives, as well as trying to structure it to be more conservative by default.
Subissues:
The text was updated successfully, but these errors were encountered: