2017-02-07 20:05:30 +00:00
|
|
|
error: `x` is shadowed by itself in `&mut x`
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:27:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = &mut x;
|
2017-10-09 13:49:54 +00:00
|
|
|
| ^^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:26:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let mut x = 1;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by itself in `{ x }`
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:28:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = { x };
|
2017-10-09 13:49:54 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:27: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
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by itself in `(&*x)`
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:29:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = (&*x);
|
2017-10-09 13:49:54 +00:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:28:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = { x };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:30:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = { *x + 1 };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
note: initialization happens here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:30:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = { *x + 1 };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:29:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = (&*x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `id(x)` which reuses the original value
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:31:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = id(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: initialization happens here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:31:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = id(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:30:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = { *x + 1 };
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `(1, x)` which reuses the original value
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:32:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = (1, x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: initialization happens here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:32:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = (1, x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:31:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = id(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `first(x)` which reuses the original value
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:33:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = first(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: initialization happens here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:33:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = first(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^^^^^^^^
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:32:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = (1, x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2020-07-26 19:07:07 +00:00
|
|
|
error: `x` is being shadowed
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:35:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = y;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
note: initialization happens here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:35:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = y;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:33:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = first(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous declaration
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:37:5
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x;
|
2017-10-09 13:49:54 +00:00
|
|
|
| ^^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2020-10-23 20:16:59 +00:00
|
|
|
--> $DIR/shadow.rs:35:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = y;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2018-01-16 16:06:27 +00:00
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|