mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-30 15:03:36 +00:00
147 lines
3.3 KiB
Text
147 lines
3.3 KiB
Text
error: `x` is shadowed by itself in `&mut x`
|
|
--> examples/shadow.rs:13:9
|
|
|
|
|
13 | let x = &mut x;
|
|
| ^^^^^^^^^^
|
|
|
|
|
= note: `-D shadow-same` implied by `-D warnings`
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:12:13
|
|
|
|
|
12 | let mut x = 1;
|
|
| ^
|
|
|
|
error: `x` is shadowed by itself in `{ x }`
|
|
--> examples/shadow.rs:14:9
|
|
|
|
|
14 | let x = { x };
|
|
| ^^^^^^^^^
|
|
|
|
|
= note: `-D shadow-same` implied by `-D warnings`
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:13:9
|
|
|
|
|
13 | let x = &mut x;
|
|
| ^
|
|
|
|
error: `x` is shadowed by itself in `(&*x)`
|
|
--> examples/shadow.rs:15:9
|
|
|
|
|
15 | let x = (&*x);
|
|
| ^^^^^^^^^
|
|
|
|
|
= note: `-D shadow-same` implied by `-D warnings`
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:14:9
|
|
|
|
|
14 | let x = { x };
|
|
| ^
|
|
|
|
error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
|
|
--> examples/shadow.rs:16:9
|
|
|
|
|
16 | let x = { *x + 1 };
|
|
| ^
|
|
|
|
|
= note: `-D shadow-reuse` implied by `-D warnings`
|
|
note: initialization happens here
|
|
--> examples/shadow.rs:16:13
|
|
|
|
|
16 | let x = { *x + 1 };
|
|
| ^^^^^^^^^^
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:15:9
|
|
|
|
|
15 | let x = (&*x);
|
|
| ^
|
|
|
|
error: `x` is shadowed by `id(x)` which reuses the original value
|
|
--> examples/shadow.rs:17:9
|
|
|
|
|
17 | let x = id(x);
|
|
| ^
|
|
|
|
|
= note: `-D shadow-reuse` implied by `-D warnings`
|
|
note: initialization happens here
|
|
--> examples/shadow.rs:17:13
|
|
|
|
|
17 | let x = id(x);
|
|
| ^^^^^
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:16:9
|
|
|
|
|
16 | let x = { *x + 1 };
|
|
| ^
|
|
|
|
error: `x` is shadowed by `(1, x)` which reuses the original value
|
|
--> examples/shadow.rs:18:9
|
|
|
|
|
18 | let x = (1, x);
|
|
| ^
|
|
|
|
|
= note: `-D shadow-reuse` implied by `-D warnings`
|
|
note: initialization happens here
|
|
--> examples/shadow.rs:18:13
|
|
|
|
|
18 | let x = (1, x);
|
|
| ^^^^^^
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:17:9
|
|
|
|
|
17 | let x = id(x);
|
|
| ^
|
|
|
|
error: `x` is shadowed by `first(x)` which reuses the original value
|
|
--> examples/shadow.rs:19:9
|
|
|
|
|
19 | let x = first(x);
|
|
| ^
|
|
|
|
|
= note: `-D shadow-reuse` implied by `-D warnings`
|
|
note: initialization happens here
|
|
--> examples/shadow.rs:19:13
|
|
|
|
|
19 | let x = first(x);
|
|
| ^^^^^^^^
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:18:9
|
|
|
|
|
18 | let x = (1, x);
|
|
| ^
|
|
|
|
error: `x` is shadowed by `y`
|
|
--> examples/shadow.rs:21:9
|
|
|
|
|
21 | let x = y;
|
|
| ^
|
|
|
|
|
= note: `-D shadow-unrelated` implied by `-D warnings`
|
|
note: initialization happens here
|
|
--> examples/shadow.rs:21:13
|
|
|
|
|
21 | let x = y;
|
|
| ^
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:19:9
|
|
|
|
|
19 | let x = first(x);
|
|
| ^
|
|
|
|
error: `x` shadows a previous declaration
|
|
--> examples/shadow.rs:23:9
|
|
|
|
|
23 | let x;
|
|
| ^
|
|
|
|
|
= note: `-D shadow-unrelated` implied by `-D warnings`
|
|
note: previous binding is here
|
|
--> examples/shadow.rs:21:9
|
|
|
|
|
21 | let x = y;
|
|
| ^
|
|
|
|
error: aborting due to 9 previous errors
|
|
|
|
error: Could not compile `clippy_tests`.
|
|
|
|
To learn more, run the command again with --verbose.
|