rust/tests/ui/shadow.stderr

234 lines
4.6 KiB
Plaintext
Raw Normal View History

2021-01-10 23:51:43 +00:00
error: `x` is shadowed by itself in `x`
--> $DIR/shadow.rs:5:9
|
2021-01-10 23:51:43 +00:00
LL | let x = x;
| ^
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:4:9
|
2021-01-10 23:51:43 +00:00
LL | let x = 1;
| ^
2021-01-10 23:51:43 +00:00
error: `mut x` is shadowed by itself in `&x`
--> $DIR/shadow.rs:6:13
|
2021-01-10 23:51:43 +00:00
LL | let mut x = &x;
| ^
|
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:5:9
|
LL | let x = x;
| ^
error: `x` is shadowed by itself in `&mut x`
--> $DIR/shadow.rs:7:9
|
2018-12-27 15:57:55 +00:00
LL | let x = &mut x;
| ^
2021-01-10 23:51:43 +00:00
|
note: previous binding is here
--> $DIR/shadow.rs:6:9
|
LL | let mut x = &x;
| ^^^^^
2021-01-10 23:51:43 +00:00
error: `x` is shadowed by itself in `*x`
--> $DIR/shadow.rs:8:9
|
2021-01-10 23:51:43 +00:00
LL | let x = *x;
| ^
|
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:7:9
|
2021-01-10 23:51:43 +00:00
LL | let x = &mut x;
| ^
2021-01-10 23:51:43 +00:00
error: `x` is shadowed by `x.0` which reuses the original value
--> $DIR/shadow.rs:13:9
|
2021-01-10 23:51:43 +00:00
LL | let x = x.0;
| ^
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:12:9
|
2021-01-10 23:51:43 +00:00
LL | let x = ([[0]], ());
| ^
2021-01-10 23:51:43 +00:00
error: `x` is shadowed by `x[0]` which reuses the original value
--> $DIR/shadow.rs:14:9
|
2021-01-10 23:51:43 +00:00
LL | let x = x[0];
| ^
|
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:13:9
|
2021-01-10 23:51:43 +00:00
LL | let x = x.0;
| ^
2021-01-10 23:51:43 +00:00
error: `x` is shadowed by `x` which reuses the original value
--> $DIR/shadow.rs:15:10
|
LL | let [x] = x;
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:14:9
|
2021-01-10 23:51:43 +00:00
LL | let x = x[0];
| ^
error: `x` is shadowed by `Some(x)` which reuses the original value
--> $DIR/shadow.rs:16:9
|
LL | let x = Some(x);
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:15:10
|
LL | let [x] = x;
| ^
error: `x` is shadowed by `foo(x)` which reuses the original value
--> $DIR/shadow.rs:17:9
|
LL | let x = foo(x);
| ^
|
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:16:9
|
2021-01-10 23:51:43 +00:00
LL | let x = Some(x);
| ^
2021-01-10 23:51:43 +00:00
error: `x` is shadowed by `|| x` which reuses the original value
--> $DIR/shadow.rs:18:9
|
2021-01-10 23:51:43 +00:00
LL | let x = || x;
| ^
|
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:17:9
|
2021-01-10 23:51:43 +00:00
LL | let x = foo(x);
| ^
2021-01-10 23:51:43 +00:00
error: `x` is shadowed by `Some(1).map(|_| x)?` which reuses the original value
--> $DIR/shadow.rs:19:9
|
2021-01-10 23:51:43 +00:00
LL | let x = Some(1).map(|_| x)?;
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:18:9
|
LL | let x = || x;
| ^
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:25:9
|
LL | let x = 2;
| ^
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:24:9
|
2021-01-10 23:51:43 +00:00
LL | let x = 1;
| ^
2021-01-10 23:51:43 +00:00
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:30:13
|
2021-01-10 23:51:43 +00:00
LL | let x = 1;
| ^
|
note: previous binding is here
2021-01-10 23:51:43 +00:00
--> $DIR/shadow.rs:29:10
|
2021-01-10 23:51:43 +00:00
LL | fn f(x: u32) {
| ^
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:35:14
|
LL | Some(x) => {
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:32:9
|
LL | let x = 1;
| ^
2021-01-10 23:51:43 +00:00
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:36:17
|
LL | let x = 1;
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:35:14
|
LL | Some(x) => {
| ^
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:40:17
|
LL | if let Some(x) = Some(1) {}
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:32:9
|
LL | let x = 1;
| ^
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:41:20
|
LL | while let Some(x) = Some(1) {}
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:32:9
|
LL | let x = 1;
| ^
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:42:15
|
LL | let _ = |[x]: [u32; 1]| {
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:32:9
|
LL | let x = 1;
| ^
error: `x` shadows a previous, unrelated binding
--> $DIR/shadow.rs:43:13
|
LL | let x = 1;
| ^
|
note: previous binding is here
--> $DIR/shadow.rs:42:15
|
LL | let _ = |[x]: [u32; 1]| {
| ^
error: aborting due to 19 previous errors
2018-01-16 16:06:27 +00:00