2017-02-07 14:05:30 -06:00
|
|
|
error: `x` is shadowed by itself in `&mut x`
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:23:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
23 | let x = &mut x;
|
2017-10-09 08:49:54 -05:00
|
|
|
| ^^^^^^^^^^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:22:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
22 | let mut x = 1;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by itself in `{ x }`
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:24:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
24 | let x = { x };
|
2017-10-09 08:49:54 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:23:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
23 | let x = &mut x;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by itself in `(&*x)`
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:25:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
25 | let x = (&*x);
|
2017-10-09 08:49:54 -05:00
|
|
|
| ^^^^^^^^^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:24:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
24 | let x = { x };
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:26:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
26 | let x = { *x + 1 };
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
note: initialization happens here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:26:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
26 | let x = { *x + 1 };
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:25:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
25 | let x = (&*x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `id(x)` which reuses the original value
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:27:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
27 | let x = id(x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: initialization happens here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:27:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
27 | let x = id(x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:26:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
26 | let x = { *x + 1 };
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `(1, x)` which reuses the original value
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:28:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
28 | let x = (1, x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: initialization happens here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:28:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
28 | let x = (1, x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:27:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
27 | let x = id(x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `first(x)` which reuses the original value
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:29:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
29 | let x = first(x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: initialization happens here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:29:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
29 | let x = first(x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^^^^^^^^
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:28:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
28 | let x = (1, x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by `y`
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:31:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
31 | let x = y;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
|
2017-02-07 14:05:30 -06:00
|
|
|
note: initialization happens here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:31:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
31 | let x = y;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:29:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
29 | let x = first(x);
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous declaration
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:33:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
33 | let x;
|
2017-10-09 08:49:54 -05:00
|
|
|
| ^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2018-10-06 11:18:06 -05:00
|
|
|
--> $DIR/shadow.rs:31:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-10-06 11:18:06 -05:00
|
|
|
31 | let x = y;
|
2017-02-07 14:05:30 -06:00
|
|
|
| ^
|
|
|
|
|
2018-01-16 10:06:27 -06:00
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
|