-
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
Newline in assignment causes false negative in undocumented_unsafe_blocks
#11534
Comments
The expected behavior is behind a configuration option. Setting |
Okay great, thanks! And yeah, I should have said false positive - I guess I meant that the false negative was failing to notice the safety comment. |
Is there a reason that isn't on by default? edit: #10832 (comment) |
There's #11170 which changes both to true. Looks like it just needs a |
Nice, fixed by #11170 |
This is still broken. It's working for E.g., this is fine:
This gives a false positive:
|
Could you open a new issue for that @jstarks? Looks like it would have a different cause |
Summary
When a newline separates the
=
sign and the beginning of anunsafe
block (as rustfmt sometimes produces), Clippy doesn't recognize a safety comment as decorating theunsafe
block:Lint Name
undocumented_unsafe_blocks
Reproducer
I tried this code:
I expected to see this happen:
Both
unsafe
blocks should have been recognized as having a safety comment.Instead, this happened:
undocumented_unsafe_blocks
fired onlet _x = ...
.Version
The text was updated successfully, but these errors were encountered: