needless_question_mark not ignored properly when implicitly returned #8392
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
#[allow(clippy::needless_question_mark)]
does not seems to prevent the lint from firing when it's applied on the last statement of a block, and is implicitly returned.It's properly taken into account when using
#![allow(clippy::needless_question_mark)]
on the whole block, or when assigninglet _ = Some(a?);
.Lint Name
needless_question_mark
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No error since this lint is disabled.
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: