Emit collapsible_match at the right node

This commit is contained in:
Alex Macleod 2025-02-27 14:21:12 +00:00
parent 527ab050fa
commit 92fc2bb2b8
2 changed files with 14 additions and 2 deletions

View file

@ -303,6 +303,18 @@ pub fn test_2(x: Issue9647) {
}
}
// https://github.com/rust-lang/rust-clippy/issues/14281
fn lint_emitted_at_right_node(opt: Option<Result<u64, String>>) {
let n = match opt {
#[expect(clippy::collapsible_match)]
Some(n) => match n {
Ok(n) => n,
_ => return,
},
None => return,
};
}
fn make<T>() -> T {
unimplemented!()
}