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