Specifying reason in expect(clippy::needless_return)
triggers false positive "this lint expectation is unfulfilled"
#13366
Labels
C-bug
Category: Clippy is not doing the correct thing
I-false-positive
Issue: The lint was triggered on code it shouldn't have
Summary
It seems the
reason
option has an effect on whether the lint warns about an unfulfilled expectation.Lint Name
clippy::needless_return
Reproducer
I tried this code:
I saw this happen:
The warning about unfulfilled expectations is printed for function
a
, but not forb
:I expected to see this happen:
No warning should be printed for either function.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: