2021-10-07 11:21:30 +02:00
|
|
|
error: `x` is shadowed by itself in `x`
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/shadow.rs:24:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = x;
|
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/shadow.rs:23:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = 1;
|
|
|
|
|
| ^
|
2022-09-22 20:04:22 +04:00
|
|
|
= note: `-D clippy::shadow-same` implied by `-D warnings`
|
2023-08-01 14:02:21 +02:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::shadow_same)]`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
error: `mut x` is shadowed by itself in `&x`
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:26:13
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let mut x = &x;
|
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2024-02-17 12:16:29 +00:00
|
|
|
--> tests/ui/shadow.rs:24:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = x;
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
error: `x` is shadowed by itself in `&mut x`
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:28:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2018-12-27 16:57:55 +01:00
|
|
|
LL | let x = &mut x;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:26:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let mut x = &x;
|
|
|
|
|
| ^^^^^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
error: `x` is shadowed by itself in `*x`
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:30:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = *x;
|
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:28:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = &mut x;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:36:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = x.0;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:35:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = ([[0]], ());
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
2022-09-22 20:04:22 +04:00
|
|
|
= note: `-D clippy::shadow-reuse` implied by `-D warnings`
|
2023-08-01 14:02:21 +02:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::shadow_reuse)]`
|
2017-02-07 21:05:30 +01:00
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:38:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = x[0];
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:36:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = x.0;
|
|
|
|
|
| ^
|
|
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:40:10
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let [x] = x;
|
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:38:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = x[0];
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:42:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = Some(x);
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:40:10
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let [x] = x;
|
|
|
|
|
| ^
|
|
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:44:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = foo(x);
|
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:42:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = Some(x);
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:46:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = || x;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:44:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = foo(x);
|
|
|
|
|
| ^
|
|
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:48:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = Some(1).map(|_| x)?;
|
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:46:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = || x;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-21 13:11:36 +02:00
|
|
|
error: `y` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:51:9
|
2021-10-21 13:11:36 +02:00
|
|
|
|
|
|
|
|
|
LL | let y = match y {
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:50:9
|
2021-10-21 13:11:36 +02:00
|
|
|
|
|
|
|
|
|
LL | let y = 1;
|
|
|
|
|
| ^
|
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:67:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = 2;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:66:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = 1;
|
|
|
|
|
| ^
|
2022-09-22 20:04:22 +04:00
|
|
|
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
|
2023-08-01 14:02:21 +02:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::shadow_unrelated)]`
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:73:13
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = 1;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:72:10
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | fn f(x: u32) {
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:79:14
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | Some(x) => {
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:76:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:81:17
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:79:14
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | Some(x) => {
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:86:17
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(1) {}
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:76:9
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:88:20
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | while let Some(x) = Some(1) {}
|
|
|
|
|
| ^
|
|
|
|
|
|
|
2017-02-07 21:05:30 +01:00
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:76:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = 1;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:90:15
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let _ = |[x]: [u32; 1]| {
|
|
|
|
|
| ^
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:76:9
|
2017-02-07 21:05:30 +01:00
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
LL | let x = 1;
|
2017-02-07 21:05:30 +01:00
|
|
|
| ^
|
|
|
|
|
|
2021-10-07 11:21:30 +02:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:92:13
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:90:15
|
2021-10-07 11:21:30 +02:00
|
|
|
|
|
|
|
|
|
LL | let _ = |[x]: [u32; 1]| {
|
|
|
|
|
| ^
|
|
|
|
|
|
2021-12-30 15:10:43 +01:00
|
|
|
error: `y` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:96:17
|
2021-12-30 15:10:43 +01:00
|
|
|
|
|
|
|
|
|
LL | if let Some(y) = y {}
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:95:9
|
2021-12-30 15:10:43 +01:00
|
|
|
|
|
|
|
|
|
LL | let y = Some(1);
|
|
|
|
|
| ^
|
|
|
|
|
|
2021-12-06 12:33:31 +01:00
|
|
|
error: `_b` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:133:9
|
2021-12-06 12:33:31 +01:00
|
|
|
|
|
|
|
|
|
LL | let _b = _a;
|
|
|
|
|
| ^^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:132:28
|
2021-12-06 12:33:31 +01:00
|
|
|
|
|
|
|
|
|
LL | pub async fn foo2(_a: i32, _b: i64) {
|
|
|
|
|
| ^^
|
|
|
|
|
|
2022-07-18 09:39:37 +02:00
|
|
|
error: `x` shadows a previous, unrelated binding
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:140:21
|
2022-07-18 09:39:37 +02:00
|
|
|
|
|
|
|
|
|
LL | if let Some(x) = Some(1) { x } else { 1 }
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:139:13
|
2022-07-18 09:39:37 +02:00
|
|
|
|
|
|
|
|
|
LL | let x = 1;
|
|
|
|
|
| ^
|
|
|
|
|
|
2024-11-12 17:31:17 +00:00
|
|
|
error: `x` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:151:20
|
2024-11-12 17:31:17 +00:00
|
|
|
|
|
|
|
|
|
LL | let z = x.map(|x| x + 1);
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:148:9
|
2024-11-12 17:31:17 +00:00
|
|
|
|
|
|
|
|
|
LL | let x = Some(1);
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
error: `i` is shadowed
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:156:25
|
2024-11-12 17:31:17 +00:00
|
|
|
|
|
|
|
|
|
LL | .map(|i| i.map(|i| i - 10))
|
|
|
|
|
| ^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:156:15
|
2024-11-12 17:31:17 +00:00
|
|
|
|
|
|
|
|
|
LL | .map(|i| i.map(|i| i - 10))
|
|
|
|
|
| ^
|
|
|
|
|
|
2024-12-08 22:33:39 +01:00
|
|
|
error: `value` is shadowed by itself in `value`
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:166:22
|
2024-12-08 22:33:39 +01:00
|
|
|
|
|
|
|
|
|
LL | let Issue13795 { value, .. } = value;
|
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
|
|
note: previous binding is here
|
2025-02-11 17:57:08 +01:00
|
|
|
--> tests/ui/shadow.rs:165:15
|
2024-12-08 22:33:39 +01:00
|
|
|
|
|
|
|
|
|
LL | fn issue13795(value: Issue13795) {
|
|
|
|
|
| ^^^^^
|
|
|
|
|
|
|
|
|
|
error: aborting due to 26 previous errors
|
2018-01-16 17:06:27 +01:00
|
|
|
|