-
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
undocumented_unsafe_blocks
false positive when unsafe block is on a separate line from a let
#10832
Comments
needs a workaround for rust-lang/rust-clippy#10832
here it goes a bit smaller reproducer
I'll try to take a look at this issue in the next days. |
I just want to be sure that we are OK in allowing the Safety comment to precede the @xFrednet do you have any opinion on this matter? Or do you think that some other team member could have a strong opinion? |
The lint documentation clearly states that the safety comment should be above the
From these options, I think number 2 is favorable. You can take a look at "Adding configuration to a lint" If you want to work on this :) |
Summary
When a single-line unsafe block is long enough to be formatted on a new line,
it appears that the safety comment isn't found.
Lint Name
undocumented_unsafe_blocks
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
Lint shouldn't fire
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: