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
Summary
Hi,
I noticed in our code base that a
matchwith aNone => Nonearm doesn't lead to a warning from thequestion_marklint.Lint Name
question_mark
Reproducer
I tried this code:
I expected to see this happen: A warning from the lint when running
cargo clippy -- -W clippy::question_markInstead, this happened: There was no warning.
Version