rust-clippy/tests/ui/shadow.stderr

160 lines
4.7 KiB
Text
Raw Normal View History

error: `x` is shadowed by itself in `&mut x`
--> $DIR/shadow.rs:13:9
|
13 | let x = &mut x; //~ERROR `x` is shadowed by itself in `&mut x`
| ^^^^^^^^^^
|
= note: #[deny(shadow_same)] implied by #[deny(clippy_pedantic)]
note: lint level defined here
--> $DIR/shadow.rs:4:17
|
4 | #![deny(clippy, clippy_pedantic)]
| ^^^^^^^^^^^^^^^
note: previous binding is here
--> $DIR/shadow.rs:12:13
|
12 | let mut x = 1;
| ^
error: `x` is shadowed by itself in `{ x }`
--> $DIR/shadow.rs:14:9
|
14 | let x = { x }; //~ERROR `x` is shadowed by itself in `{ x }`
| ^^^^^^^^^
|
= note: #[deny(shadow_same)] implied by #[deny(clippy_pedantic)]
note: previous binding is here
--> $DIR/shadow.rs:13:9
|
13 | let x = &mut x; //~ERROR `x` is shadowed by itself in `&mut x`
| ^
error: `x` is shadowed by itself in `(&*x)`
--> $DIR/shadow.rs:15:9
|
15 | let x = (&*x); //~ERROR `x` is shadowed by itself in `(&*x)`
| ^^^^^^^^^
|
= note: #[deny(shadow_same)] implied by #[deny(clippy_pedantic)]
note: previous binding is here
--> $DIR/shadow.rs:14:9
|
14 | let x = { x }; //~ERROR `x` is shadowed by itself in `{ x }`
| ^
error: `x` is shadowed by `{ *x + 1 }` which reuses the original value
--> $DIR/shadow.rs:16:9
|
16 | let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
| ^
|
= note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
note: lint level defined here
--> $DIR/shadow.rs:4:17
|
4 | #![deny(clippy, clippy_pedantic)]
| ^^^^^^^^^^^^^^^
note: initialization happens here
--> $DIR/shadow.rs:16:13
|
16 | let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
| ^^^^^^^^^^
note: previous binding is here
--> $DIR/shadow.rs:15:9
|
15 | let x = (&*x); //~ERROR `x` is shadowed by itself in `(&*x)`
| ^
error: `x` is shadowed by `id(x)` which reuses the original value
--> $DIR/shadow.rs:17:9
|
17 | let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
| ^
|
= note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
note: initialization happens here
--> $DIR/shadow.rs:17:13
|
17 | let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
| ^^^^^
note: previous binding is here
--> $DIR/shadow.rs:16:9
|
16 | let x = { *x + 1 }; //~ERROR `x` is shadowed by `{ *x + 1 }` which reuses
| ^
error: `x` is shadowed by `(1, x)` which reuses the original value
--> $DIR/shadow.rs:18:9
|
18 | let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
| ^
|
= note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
note: initialization happens here
--> $DIR/shadow.rs:18:13
|
18 | let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
| ^^^^^^
note: previous binding is here
--> $DIR/shadow.rs:17:9
|
17 | let x = id(x); //~ERROR `x` is shadowed by `id(x)` which reuses
| ^
error: `x` is shadowed by `first(x)` which reuses the original value
--> $DIR/shadow.rs:19:9
|
19 | let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
| ^
|
= note: #[deny(shadow_reuse)] implied by #[deny(clippy_pedantic)]
note: initialization happens here
--> $DIR/shadow.rs:19:13
|
19 | let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
| ^^^^^^^^
note: previous binding is here
--> $DIR/shadow.rs:18:9
|
18 | let x = (1, x); //~ERROR `x` is shadowed by `(1, x)` which reuses
| ^
error: `x` is shadowed by `y`
--> $DIR/shadow.rs:21:9
|
21 | let x = y; //~ERROR `x` is shadowed by `y`
| ^
|
= note: #[deny(shadow_unrelated)] implied by #[deny(clippy_pedantic)]
note: lint level defined here
--> $DIR/shadow.rs:4:17
|
4 | #![deny(clippy, clippy_pedantic)]
| ^^^^^^^^^^^^^^^
note: initialization happens here
--> $DIR/shadow.rs:21:13
|
21 | let x = y; //~ERROR `x` is shadowed by `y`
| ^
note: previous binding is here
--> $DIR/shadow.rs:19:9
|
19 | let x = first(x); //~ERROR `x` is shadowed by `first(x)` which reuses
| ^
error: `x` shadows a previous declaration
--> $DIR/shadow.rs:23:9
|
23 | let x; //~ERROR `x` shadows a previous declaration
| ^
|
= note: #[deny(shadow_unrelated)] implied by #[deny(clippy_pedantic)]
note: previous binding is here
--> $DIR/shadow.rs:21:9
|
21 | let x = y; //~ERROR `x` is shadowed by `y`
| ^
error: aborting due to 9 previous errors