You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, a warning should only be issued when compiling to a 64-bit target, since casting a pointer to u32 is perfectly valid on 32-bit targets. Maybe something like "Warning: cast to u32 may truncate pointer value". If truncation is really intended then the warning can be avoided by adding an intermediate usize cast.
Since new lints have a big impact on users of rustc, the policy is that they should go through the RFC process like other user-facing changes. As such, I'm going to give this one a close, but if anyone comes across this ticket and wants this lint, consider adding it to clippy and/or writing up an RFC. Thanks!
There should be a lint that warns if you cast a pointer to any integer smaller than usize. For example to prevent cases like this:
The text was updated successfully, but these errors were encountered: