1 #![warn(clippy::shadow_same, clippy::shadow_reuse, clippy::shadow_unrelated)]
2 #![allow(clippy::let_unit_value)]
12 fn shadow_reuse() -> Option<()> {
20 let x = Some(1).map(|_| x)?;
29 fn shadow_unrelated() {
46 if let Some(x) = Some(1) {}
47 while let Some(x) = Some(1) {}
48 let _ = |[x]: [u32; 1]| {
57 Some(x) if x == 1 => {},
61 match [None, Some(1)] {
62 [Some(x), None] | [None, Some(x)] => {},
65 if let Some(x) = Some(1) {
72 #[allow(clippy::shadow_unrelated)]
78 fn question_mark() -> Option<()> {
80 // `?` expands with a `val` binding
85 pub async fn foo1(_a: i32) {}
87 pub async fn foo2(_a: i32, _b: i64) {
94 if let Some(x) = Some(1) { x } else { 1 }