-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Open
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Description
Summary
Hi,
I noticed in our code base that a match with a None => None arm doesn't lead to a warning from the question_mark lint.
Lint Name
question_mark
Reproducer
I tried this code:
fn main() {
let _x = example(Some(12));
}
fn example(v: Option<usize>) -> Option<usize> {
match v {
Some(n) => {
println!("{n}");
Some(42)
}
None => None,
}
}I expected to see this happen: A warning from the lint when running cargo clippy -- -W clippy::question_mark
Instead, this happened: There was no warning.
Version
rustc 1.94.0 (4a4ef493e 2026-03-02)
binary: rustc
commit-hash: 4a4ef493e3a1488c6e321570238084b38948f6db
commit-date: 2026-03-02
host: x86_64-unknown-linux-gnu
release: 1.94.0
LLVM version: 21.1.8
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-bugCategory: Clippy is not doing the correct thingCategory: Clippy is not doing the correct thingI-false-negativeIssue: The lint should have been triggered on code, but wasn'tIssue: The lint should have been triggered on code, but wasn't
Type
Fields
Give feedbackNo fields configured for issues without a type.