rust/tests/ui/shadow.stderr

139 lines
2.8 KiB
Plaintext
Raw Normal View History

error: `x` is shadowed by itself in `&mut x`
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:29:5
|
2018-12-27 16:57:55 +01:00
LL | let x = &mut x;
| ^^^^^^^^^^^^^^^
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:28:13
|
2018-12-27 16:57:55 +01:00
LL | let mut x = 1;
| ^
error: `x` is shadowed by itself in `{ x }`
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:30:5
|
2018-12-27 16:57:55 +01:00
LL | let x = { x };
| ^^^^^^^^^^^^^^
|
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:29:9
|
2018-12-27 16:57:55 +01:00
LL | let x = &mut x;
| ^
error: `x` is shadowed by itself in `(&*x)`
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:31:5
|
2018-12-27 16:57:55 +01:00
LL | let x = (&*x);
| ^^^^^^^^^^^^^^
|
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:30:9
|
2018-12-27 16:57:55 +01:00
LL | let x = { x };
| ^
error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:32:9
|
2018-12-27 16:57:55 +01:00
LL | let x = { *x + 1 };
| ^
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
note: initialization happens here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:32:13
|
2018-12-27 16:57:55 +01:00
LL | let x = { *x + 1 };
| ^^^^^^^^^^
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:31:9
|
2018-12-27 16:57:55 +01:00
LL | let x = (&*x);
| ^
error: `x` is shadowed by `id(x)` which reuses the original value
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:33:9
|
2018-12-27 16:57:55 +01:00
LL | let x = id(x);
| ^
|
note: initialization happens here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:33:13
|
2018-12-27 16:57:55 +01:00
LL | let x = id(x);
| ^^^^^
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:32:9
|
2018-12-27 16:57:55 +01:00
LL | let x = { *x + 1 };
| ^
error: `x` is shadowed by `(1, x)` which reuses the original value
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:34:9
|
2018-12-27 16:57:55 +01:00
LL | let x = (1, x);
| ^
|
note: initialization happens here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:34:13
|
2018-12-27 16:57:55 +01:00
LL | let x = (1, x);
| ^^^^^^
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:33:9
|
2018-12-27 16:57:55 +01:00
LL | let x = id(x);
| ^
error: `x` is shadowed by `first(x)` which reuses the original value
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:35:9
|
2018-12-27 16:57:55 +01:00
LL | let x = first(x);
| ^
|
note: initialization happens here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:35:13
|
2018-12-27 16:57:55 +01:00
LL | let x = first(x);
| ^^^^^^^^
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:34:9
|
2018-12-27 16:57:55 +01:00
LL | let x = (1, x);
| ^
error: `x` is shadowed by `y`
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:37:9
|
2018-12-27 16:57:55 +01:00
LL | let x = y;
| ^
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
note: initialization happens here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:37:13
|
2018-12-27 16:57:55 +01:00
LL | let x = y;
| ^
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:35:9
|
2018-12-27 16:57:55 +01:00
LL | let x = first(x);
| ^
error: `x` shadows a previous declaration
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:39:5
|
2018-12-27 16:57:55 +01:00
LL | let x;
| ^^^^^^
|
note: previous binding is here
2018-12-10 06:27:19 +01:00
--> $DIR/shadow.rs:37:9
|
2018-12-27 16:57:55 +01:00
LL | let x = y;
| ^
2018-01-16 17:06:27 +01:00
error: aborting due to 9 previous errors