]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/shadow.rs
a394ef8f25c675b529db3c275eb97308fe835b5b
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) {