2021-01-10 23:51:43 +00:00
|
|
|
error: `x` is shadowed by itself in `x`
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:6:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = x;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:5:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
error: `mut x` is shadowed by itself in `&x`
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:7:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let mut x = &x;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:6:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = x;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` is shadowed by itself in `&mut x`
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:8:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let x = &mut x;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:7:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let mut x = &x;
|
|
|
|
| ^^^^^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
error: `x` is shadowed by itself in `*x`
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:9:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = *x;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:8:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = &mut x;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `x` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:14:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = x.0;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:13:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = ([[0]], ());
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `x` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:15:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = x[0];
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:14:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = x.0;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `x` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:16:10
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let [x] = x;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:15:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = x[0];
|
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `x` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:17:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = Some(x);
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:16:10
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let [x] = x;
|
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `x` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:18:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = foo(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:17:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = Some(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `x` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:19:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = || x;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:18:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = foo(x);
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `x` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:20:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = Some(1).map(|_| x)?;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:19:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = || x;
|
|
|
|
| ^
|
|
|
|
|
2021-10-07 08:39:13 +00:00
|
|
|
error: `y` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:22:9
|
2021-10-07 08:39:13 +00:00
|
|
|
|
|
|
|
|
LL | let y = match y {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:21:9
|
2021-10-07 08:39:13 +00:00
|
|
|
|
|
|
|
|
LL | let y = 1;
|
|
|
|
| ^
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:31:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = 2;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
|
2018-08-01 14:30:44 +00:00
|
|
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
|
2017-02-07 20:05:30 +00:00
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:30:9
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = 1;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:36:13
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:35:10
|
2017-02-07 20:05:30 +00:00
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
LL | fn f(x: u32) {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:41:14
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | Some(x) => {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:38:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
2017-02-07 20:05:30 +00:00
|
|
|
| ^
|
|
|
|
|
2021-01-10 23:51:43 +00:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:42:17
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:41:14
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | Some(x) => {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:46:17
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(1) {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:38:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:47:20
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | while let Some(x) = Some(1) {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:38:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:48:15
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let _ = |[x]: [u32; 1]| {
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:38:9
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:49:13
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:48:15
|
2021-01-10 23:51:43 +00:00
|
|
|
|
|
|
|
|
LL | let _ = |[x]: [u32; 1]| {
|
|
|
|
| ^
|
|
|
|
|
2021-12-24 21:20:40 +00:00
|
|
|
error: `y` is shadowed
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:52:17
|
2021-12-24 21:20:40 +00:00
|
|
|
|
|
|
|
|
LL | if let Some(y) = y {}
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:51:9
|
2021-12-24 21:20:40 +00:00
|
|
|
|
|
|
|
|
LL | let y = Some(1);
|
|
|
|
| ^
|
|
|
|
|
2021-11-19 08:46:34 +00:00
|
|
|
error: `_b` shadows a previous, unrelated binding
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:88:9
|
2021-11-19 08:46:34 +00:00
|
|
|
|
|
|
|
|
LL | let _b = _a;
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2022-03-17 23:53:28 +00:00
|
|
|
--> $DIR/shadow.rs:87:28
|
2021-11-19 08:46:34 +00:00
|
|
|
|
|
|
|
|
LL | pub async fn foo2(_a: i32, _b: i64) {
|
|
|
|
| ^^
|
|
|
|
|
2021-12-24 21:20:40 +00:00
|
|
|
error: aborting due to 22 previous errors
|
2018-01-16 16:06:27 +00:00
|
|
|
|