unnecessary_safety_comment
does not lint for the first line
#14553
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-negative
Issue: The lint should have been triggered on code, but wasn't
Uh oh!
There was an error while loading. Please reload this page.
Summary
unnecessary_safety_comment
does not take into account a// SAFETY
comment in the first line.Possibly related: #14554.
Possibly related: #14555.
Possibly related: #14556.
Lint Name
unnecessary_safety_comment
Reproducer
https://godbolt.org/z/ejTxeq148
I tried this code:
I expected to see this happen: Two lints, for both safety comments.
Instead, this happened: Only the comment on
y
is linted.Note that adding a single newline on top, or a comment, or an item, will make it work again, e.g.:
Version
The text was updated successfully, but these errors were encountered: