unnecessary_safety_comment
does not lint the first item of a module without a body
#14554
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 lint the first item inside a module without a body (i.e. loaded from a file).Possibly related: #14553.
Possibly related: #14555.
Possibly related: #14556.
Lint Name
unnecessary_safety_comment
Reproducer
https://godbolt.org/z/776jh93s8
I tried this code:
File
a.rs
:File
b.rs
:I expected to see this happen: Two lints, for both safety comments.
Instead, this happened: Only the comment on
y
is linted.Note that there is no false negative if we embed module
b
:Version
The text was updated successfully, but these errors were encountered: