4 #![allow(unused_parens, unused_variables)]
5 #![deny(clippy, clippy_pedantic)]
7 fn id<T>(x: T) -> T { x }
9 fn first(x: (isize, isize)) -> isize { x.0 }
13 let x = &mut x; //~ERROR `x` is shadowed by itself in `&mut x`
14 let x = { x }; //~ERROR `x` is shadowed by itself in `{ x }`
15 let x = (&*x); //~ERROR `x` is shadowed by itself in `(&*x)`
16 let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
17 let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
18 let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
19 let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
21 let x = y; //~ERROR `x` is shadowed by `y`
25 if let Some(p) = o { assert_eq!(1, p); }
27 Some(p) => p, // no error, because the p above is in its own scope
32 (1, Some(a)) | (a, Some(1)) => (), // no error though `a` appears twice