@@ -47,7 +47,7 @@ note: previous binding is here
4747LL | let x = &mut x;
4848 | ^
4949
50- error: `x` is shadowed by `x.0` which reuses the original value
50+ error: `x` is shadowed
5151 --> $DIR/shadow.rs:13:9
5252 |
5353LL | let x = x.0;
@@ -60,7 +60,7 @@ note: previous binding is here
6060LL | let x = ([[0]], ());
6161 | ^
6262
63- error: `x` is shadowed by `x[0]` which reuses the original value
63+ error: `x` is shadowed
6464 --> $DIR/shadow.rs:14:9
6565 |
6666LL | let x = x[0];
@@ -72,7 +72,7 @@ note: previous binding is here
7272LL | let x = x.0;
7373 | ^
7474
75- error: `x` is shadowed by `x` which reuses the original value
75+ error: `x` is shadowed
7676 --> $DIR/shadow.rs:15:10
7777 |
7878LL | let [x] = x;
@@ -84,7 +84,7 @@ note: previous binding is here
8484LL | let x = x[0];
8585 | ^
8686
87- error: `x` is shadowed by `Some(x)` which reuses the original value
87+ error: `x` is shadowed
8888 --> $DIR/shadow.rs:16:9
8989 |
9090LL | let x = Some(x);
@@ -96,7 +96,7 @@ note: previous binding is here
9696LL | let [x] = x;
9797 | ^
9898
99- error: `x` is shadowed by `foo(x)` which reuses the original value
99+ error: `x` is shadowed
100100 --> $DIR/shadow.rs:17:9
101101 |
102102LL | let x = foo(x);
@@ -108,7 +108,7 @@ note: previous binding is here
108108LL | let x = Some(x);
109109 | ^
110110
111- error: `x` is shadowed by `|| x` which reuses the original value
111+ error: `x` is shadowed
112112 --> $DIR/shadow.rs:18:9
113113 |
114114LL | let x = || x;
@@ -120,7 +120,7 @@ note: previous binding is here
120120LL | let x = foo(x);
121121 | ^
122122
123- error: `x` is shadowed by `Some(1).map(|_| x)?` which reuses the original value
123+ error: `x` is shadowed
124124 --> $DIR/shadow.rs:19:9
125125 |
126126LL | let x = Some(1).map(|_| x)?;
@@ -132,102 +132,114 @@ note: previous binding is here
132132LL | let x = || x;
133133 | ^
134134
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+
135147error: `x` shadows a previous, unrelated binding
136- --> $DIR/shadow.rs:25 :9
148+ --> $DIR/shadow.rs:30 :9
137149 |
138150LL | let x = 2;
139151 | ^
140152 |
141153 = note: `-D clippy::shadow-unrelated` implied by `-D warnings`
142154note: previous binding is here
143- --> $DIR/shadow.rs:24 :9
155+ --> $DIR/shadow.rs:29 :9
144156 |
145157LL | let x = 1;
146158 | ^
147159
148160error: `x` shadows a previous, unrelated binding
149- --> $DIR/shadow.rs:30 :13
161+ --> $DIR/shadow.rs:35 :13
150162 |
151163LL | let x = 1;
152164 | ^
153165 |
154166note: previous binding is here
155- --> $DIR/shadow.rs:29 :10
167+ --> $DIR/shadow.rs:34 :10
156168 |
157169LL | fn f(x: u32) {
158170 | ^
159171
160172error: `x` shadows a previous, unrelated binding
161- --> $DIR/shadow.rs:35 :14
173+ --> $DIR/shadow.rs:40 :14
162174 |
163175LL | Some(x) => {
164176 | ^
165177 |
166178note: previous binding is here
167- --> $DIR/shadow.rs:32 :9
179+ --> $DIR/shadow.rs:37 :9
168180 |
169181LL | let x = 1;
170182 | ^
171183
172184error: `x` shadows a previous, unrelated binding
173- --> $DIR/shadow.rs:36 :17
185+ --> $DIR/shadow.rs:41 :17
174186 |
175187LL | let x = 1;
176188 | ^
177189 |
178190note: previous binding is here
179- --> $DIR/shadow.rs:35 :14
191+ --> $DIR/shadow.rs:40 :14
180192 |
181193LL | Some(x) => {
182194 | ^
183195
184196error: `x` shadows a previous, unrelated binding
185- --> $DIR/shadow.rs:40 :17
197+ --> $DIR/shadow.rs:45 :17
186198 |
187199LL | if let Some(x) = Some(1) {}
188200 | ^
189201 |
190202note: previous binding is here
191- --> $DIR/shadow.rs:32 :9
203+ --> $DIR/shadow.rs:37 :9
192204 |
193205LL | let x = 1;
194206 | ^
195207
196208error: `x` shadows a previous, unrelated binding
197- --> $DIR/shadow.rs:41 :20
209+ --> $DIR/shadow.rs:46 :20
198210 |
199211LL | while let Some(x) = Some(1) {}
200212 | ^
201213 |
202214note: previous binding is here
203- --> $DIR/shadow.rs:32 :9
215+ --> $DIR/shadow.rs:37 :9
204216 |
205217LL | let x = 1;
206218 | ^
207219
208220error: `x` shadows a previous, unrelated binding
209- --> $DIR/shadow.rs:42 :15
221+ --> $DIR/shadow.rs:47 :15
210222 |
211223LL | let _ = |[x]: [u32; 1]| {
212224 | ^
213225 |
214226note: previous binding is here
215- --> $DIR/shadow.rs:32 :9
227+ --> $DIR/shadow.rs:37 :9
216228 |
217229LL | let x = 1;
218230 | ^
219231
220232error: `x` shadows a previous, unrelated binding
221- --> $DIR/shadow.rs:43 :13
233+ --> $DIR/shadow.rs:48 :13
222234 |
223235LL | let x = 1;
224236 | ^
225237 |
226238note: previous binding is here
227- --> $DIR/shadow.rs:42 :15
239+ --> $DIR/shadow.rs:47 :15
228240 |
229241LL | let _ = |[x]: [u32; 1]| {
230242 | ^
231243
232- error: aborting due to 19 previous errors
244+ error: aborting due to 20 previous errors
233245
0 commit comments