@@ -47,7 +47,7 @@ note: previous binding is here
47
47
LL | let x = &mut x;
48
48
| ^
49
49
50
- error: `x` is shadowed by `x.0` which reuses the original value
50
+ error: `x` is shadowed
51
51
--> $DIR/shadow.rs:13:9
52
52
|
53
53
LL | let x = x.0;
@@ -60,7 +60,7 @@ note: previous binding is here
60
60
LL | let x = ([[0]], ());
61
61
| ^
62
62
63
- error: `x` is shadowed by `x[0]` which reuses the original value
63
+ error: `x` is shadowed
64
64
--> $DIR/shadow.rs:14:9
65
65
|
66
66
LL | let x = x[0];
@@ -72,7 +72,7 @@ note: previous binding is here
72
72
LL | let x = x.0;
73
73
| ^
74
74
75
- error: `x` is shadowed by `x` which reuses the original value
75
+ error: `x` is shadowed
76
76
--> $DIR/shadow.rs:15:10
77
77
|
78
78
LL | let [x] = x;
@@ -84,7 +84,7 @@ note: previous binding is here
84
84
LL | let x = x[0];
85
85
| ^
86
86
87
- error: `x` is shadowed by `Some(x)` which reuses the original value
87
+ error: `x` is shadowed
88
88
--> $DIR/shadow.rs:16:9
89
89
|
90
90
LL | let x = Some(x);
@@ -96,7 +96,7 @@ note: previous binding is here
96
96
LL | let [x] = x;
97
97
| ^
98
98
99
- error: `x` is shadowed by `foo(x)` which reuses the original value
99
+ error: `x` is shadowed
100
100
--> $DIR/shadow.rs:17:9
101
101
|
102
102
LL | let x = foo(x);
@@ -108,7 +108,7 @@ note: previous binding is here
108
108
LL | let x = Some(x);
109
109
| ^
110
110
111
- error: `x` is shadowed by `|| x` which reuses the original value
111
+ error: `x` is shadowed
112
112
--> $DIR/shadow.rs:18:9
113
113
|
114
114
LL | let x = || x;
@@ -120,7 +120,7 @@ note: previous binding is here
120
120
LL | let x = foo(x);
121
121
| ^
122
122
123
- error: `x` is shadowed by `Some(1).map(|_| x)?` which reuses the original value
123
+ error: `x` is shadowed
124
124
--> $DIR/shadow.rs:19:9
125
125
|
126
126
LL | let x = Some(1).map(|_| x)?;
@@ -132,102 +132,114 @@ note: previous binding is here
132
132
LL | let x = || x;
133
133
| ^
134
134
135
+ error: `y` is shadowed
136
+ --> $DIR/shadow.rs:21:9
137
+ |
138
+ LL | let y = match y {
139
+ | ^
140
+ |
141
+ note: previous binding is here
142
+ --> $DIR/shadow.rs:20:9
143
+ |
144
+ LL | let y = 1;
145
+ | ^
146
+
135
147
error: `x` shadows a previous, unrelated binding
136
- --> $DIR/shadow.rs:25 :9
148
+ --> $DIR/shadow.rs:30 :9
137
149
|
138
150
LL | let x = 2;
139
151
| ^
140
152
|
141
153
= note: `-D clippy::shadow-unrelated` implied by `-D warnings`
142
154
note: previous binding is here
143
- --> $DIR/shadow.rs:24 :9
155
+ --> $DIR/shadow.rs:29 :9
144
156
|
145
157
LL | let x = 1;
146
158
| ^
147
159
148
160
error: `x` shadows a previous, unrelated binding
149
- --> $DIR/shadow.rs:30 :13
161
+ --> $DIR/shadow.rs:35 :13
150
162
|
151
163
LL | let x = 1;
152
164
| ^
153
165
|
154
166
note: previous binding is here
155
- --> $DIR/shadow.rs:29 :10
167
+ --> $DIR/shadow.rs:34 :10
156
168
|
157
169
LL | fn f(x: u32) {
158
170
| ^
159
171
160
172
error: `x` shadows a previous, unrelated binding
161
- --> $DIR/shadow.rs:35 :14
173
+ --> $DIR/shadow.rs:40 :14
162
174
|
163
175
LL | Some(x) => {
164
176
| ^
165
177
|
166
178
note: previous binding is here
167
- --> $DIR/shadow.rs:32 :9
179
+ --> $DIR/shadow.rs:37 :9
168
180
|
169
181
LL | let x = 1;
170
182
| ^
171
183
172
184
error: `x` shadows a previous, unrelated binding
173
- --> $DIR/shadow.rs:36 :17
185
+ --> $DIR/shadow.rs:41 :17
174
186
|
175
187
LL | let x = 1;
176
188
| ^
177
189
|
178
190
note: previous binding is here
179
- --> $DIR/shadow.rs:35 :14
191
+ --> $DIR/shadow.rs:40 :14
180
192
|
181
193
LL | Some(x) => {
182
194
| ^
183
195
184
196
error: `x` shadows a previous, unrelated binding
185
- --> $DIR/shadow.rs:40 :17
197
+ --> $DIR/shadow.rs:45 :17
186
198
|
187
199
LL | if let Some(x) = Some(1) {}
188
200
| ^
189
201
|
190
202
note: previous binding is here
191
- --> $DIR/shadow.rs:32 :9
203
+ --> $DIR/shadow.rs:37 :9
192
204
|
193
205
LL | let x = 1;
194
206
| ^
195
207
196
208
error: `x` shadows a previous, unrelated binding
197
- --> $DIR/shadow.rs:41 :20
209
+ --> $DIR/shadow.rs:46 :20
198
210
|
199
211
LL | while let Some(x) = Some(1) {}
200
212
| ^
201
213
|
202
214
note: previous binding is here
203
- --> $DIR/shadow.rs:32 :9
215
+ --> $DIR/shadow.rs:37 :9
204
216
|
205
217
LL | let x = 1;
206
218
| ^
207
219
208
220
error: `x` shadows a previous, unrelated binding
209
- --> $DIR/shadow.rs:42 :15
221
+ --> $DIR/shadow.rs:47 :15
210
222
|
211
223
LL | let _ = |[x]: [u32; 1]| {
212
224
| ^
213
225
|
214
226
note: previous binding is here
215
- --> $DIR/shadow.rs:32 :9
227
+ --> $DIR/shadow.rs:37 :9
216
228
|
217
229
LL | let x = 1;
218
230
| ^
219
231
220
232
error: `x` shadows a previous, unrelated binding
221
- --> $DIR/shadow.rs:43 :13
233
+ --> $DIR/shadow.rs:48 :13
222
234
|
223
235
LL | let x = 1;
224
236
| ^
225
237
|
226
238
note: previous binding is here
227
- --> $DIR/shadow.rs:42 :15
239
+ --> $DIR/shadow.rs:47 :15
228
240
|
229
241
LL | let _ = |[x]: [u32; 1]| {
230
242
| ^
231
243
232
- error: aborting due to 19 previous errors
244
+ error: aborting due to 20 previous errors
233
245
0 commit comments