2021-10-07 09:21:30 +00:00
|
|
|
error: `x` is shadowed by itself in `x`
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:19:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = x;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:18:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
error: `mut x` is shadowed by itself in `&x`
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:20:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let mut x = &x;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:19:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = x;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by itself in `&mut x`
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:21:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = &mut x;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:20:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let mut x = &x;
|
|
|
|
| ^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
error: `x` is shadowed by itself in `*x`
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:22:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = *x;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:21:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = &mut x;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `x` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:27:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = x.0;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:26:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = ([[0]], ());
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `x` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:28:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = x[0];
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:27:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = x.0;
|
|
|
|
| ^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `x` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:29:10
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let [x] = x;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:28:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = x[0];
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `x` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:30:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = Some(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:29:10
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let [x] = x;
|
|
|
|
| ^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `x` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:31:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = foo(x);
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:30:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = Some(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `x` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:32:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = || x;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:31:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = foo(x);
|
|
|
|
| ^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `x` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:33:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = Some(1).map(|_| x)?;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:32:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = || x;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-21 11:11:36 +00:00
|
|
|
error: `y` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:35:9
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let y = match y {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:34:9
|
2021-10-21 11:11:36 +00:00
|
|
|
|
|
|
|
|
LL | let y = 1;
|
|
|
|
| ^
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:50:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = 2;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:49:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
2022-09-22 16:04:22 +00:00
|
|
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:55:13
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:54:10
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | fn f(x: u32) {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:60:14
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | Some(x) => {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:57:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:61:17
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:60:14
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | Some(x) => {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:65:17
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(1) {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:57:9
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:66:20
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | while let Some(x) = Some(1) {}
|
|
|
|
| ^
|
|
|
|
|
|
2017-02-07 20:05:30 +00:00
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:57:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = 1;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:67:15
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let _ = |[x]: [u32; 1]| {
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:57:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
LL | let x = 1;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-07 09:21:30 +00:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:68:13
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:67:15
|
2021-10-07 09:21:30 +00:00
|
|
|
|
|
|
|
|
LL | let _ = |[x]: [u32; 1]| {
|
|
|
|
| ^
|
|
|
|
|
2021-12-30 14:10:43 +00:00
|
|
|
error: `y` is shadowed
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:71:17
|
2021-12-30 14:10:43 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(y) = y {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:70:9
|
2021-12-30 14:10:43 +00:00
|
|
|
|
|
|
|
|
LL | let y = Some(1);
|
|
|
|
| ^
|
|
|
|
|
2021-12-06 11:33:31 +00:00
|
|
|
error: `_b` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:107:9
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
LL | let _b = _a;
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:106:28
|
2021-12-06 11:33:31 +00:00
|
|
|
|
|
|
|
|
LL | pub async fn foo2(_a: i32, _b: i64) {
|
|
|
|
| ^^
|
|
|
|
|
2022-07-18 07:39:37 +00:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:113:21
|
2022-07-18 07:39:37 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(1) { x } else { 1 }
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2023-04-22 19:28:08 +00:00
|
|
|
--> $DIR/shadow.rs:112:13
|
2022-07-18 07:39:37 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: aborting due to 23 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|