]> git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/shadow.stderr
New upstream version 1.66.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / shadow.stderr
1 error: `x` is shadowed by itself in `x`
2 --> $DIR/shadow.rs:6:9
3 |
4 LL | let x = x;
5 | ^
6 |
7 note: previous binding is here
8 --> $DIR/shadow.rs:5:9
9 |
10 LL | let x = 1;
11 | ^
12 = note: `-D clippy::shadow-same` implied by `-D warnings`
13
14 error: `mut x` is shadowed by itself in `&x`
15 --> $DIR/shadow.rs:7:13
16 |
17 LL | let mut x = &x;
18 | ^
19 |
20 note: previous binding is here
21 --> $DIR/shadow.rs:6:9
22 |
23 LL | let x = x;
24 | ^
25
26 error: `x` is shadowed by itself in `&mut x`
27 --> $DIR/shadow.rs:8:9
28 |
29 LL | let x = &mut x;
30 | ^
31 |
32 note: previous binding is here
33 --> $DIR/shadow.rs:7:9
34 |
35 LL | let mut x = &x;
36 | ^^^^^
37
38 error: `x` is shadowed by itself in `*x`
39 --> $DIR/shadow.rs:9:9
40 |
41 LL | let x = *x;
42 | ^
43 |
44 note: previous binding is here
45 --> $DIR/shadow.rs:8:9
46 |
47 LL | let x = &mut x;
48 | ^
49
50 error: `x` is shadowed
51 --> $DIR/shadow.rs:14:9
52 |
53 LL | let x = x.0;
54 | ^
55 |
56 note: previous binding is here
57 --> $DIR/shadow.rs:13:9
58 |
59 LL | let x = ([[0]], ());
60 | ^
61 = note: `-D clippy::shadow-reuse` implied by `-D warnings`
62
63 error: `x` is shadowed
64 --> $DIR/shadow.rs:15:9
65 |
66 LL | let x = x[0];
67 | ^
68 |
69 note: previous binding is here
70 --> $DIR/shadow.rs:14:9
71 |
72 LL | let x = x.0;
73 | ^
74
75 error: `x` is shadowed
76 --> $DIR/shadow.rs:16:10
77 |
78 LL | let [x] = x;
79 | ^
80 |
81 note: previous binding is here
82 --> $DIR/shadow.rs:15:9
83 |
84 LL | let x = x[0];
85 | ^
86
87 error: `x` is shadowed
88 --> $DIR/shadow.rs:17:9
89 |
90 LL | let x = Some(x);
91 | ^
92 |
93 note: previous binding is here
94 --> $DIR/shadow.rs:16:10
95 |
96 LL | let [x] = x;
97 | ^
98
99 error: `x` is shadowed
100 --> $DIR/shadow.rs:18:9
101 |
102 LL | let x = foo(x);
103 | ^
104 |
105 note: previous binding is here
106 --> $DIR/shadow.rs:17:9
107 |
108 LL | let x = Some(x);
109 | ^
110
111 error: `x` is shadowed
112 --> $DIR/shadow.rs:19:9
113 |
114 LL | let x = || x;
115 | ^
116 |
117 note: previous binding is here
118 --> $DIR/shadow.rs:18:9
119 |
120 LL | let x = foo(x);
121 | ^
122
123 error: `x` is shadowed
124 --> $DIR/shadow.rs:20:9
125 |
126 LL | let x = Some(1).map(|_| x)?;
127 | ^
128 |
129 note: previous binding is here
130 --> $DIR/shadow.rs:19:9
131 |
132 LL | let x = || x;
133 | ^
134
135 error: `y` is shadowed
136 --> $DIR/shadow.rs:22:9
137 |
138 LL | let y = match y {
139 | ^
140 |
141 note: previous binding is here
142 --> $DIR/shadow.rs:21:9
143 |
144 LL | let y = 1;
145 | ^
146
147 error: `x` shadows a previous, unrelated binding
148 --> $DIR/shadow.rs:31:9
149 |
150 LL | let x = 2;
151 | ^
152 |
153 note: previous binding is here
154 --> $DIR/shadow.rs:30:9
155 |
156 LL | let x = 1;
157 | ^
158 = note: `-D clippy::shadow-unrelated` implied by `-D warnings`
159
160 error: `x` shadows a previous, unrelated binding
161 --> $DIR/shadow.rs:36:13
162 |
163 LL | let x = 1;
164 | ^
165 |
166 note: previous binding is here
167 --> $DIR/shadow.rs:35:10
168 |
169 LL | fn f(x: u32) {
170 | ^
171
172 error: `x` shadows a previous, unrelated binding
173 --> $DIR/shadow.rs:41:14
174 |
175 LL | Some(x) => {
176 | ^
177 |
178 note: previous binding is here
179 --> $DIR/shadow.rs:38:9
180 |
181 LL | let x = 1;
182 | ^
183
184 error: `x` shadows a previous, unrelated binding
185 --> $DIR/shadow.rs:42:17
186 |
187 LL | let x = 1;
188 | ^
189 |
190 note: previous binding is here
191 --> $DIR/shadow.rs:41:14
192 |
193 LL | Some(x) => {
194 | ^
195
196 error: `x` shadows a previous, unrelated binding
197 --> $DIR/shadow.rs:46:17
198 |
199 LL | if let Some(x) = Some(1) {}
200 | ^
201 |
202 note: previous binding is here
203 --> $DIR/shadow.rs:38:9
204 |
205 LL | let x = 1;
206 | ^
207
208 error: `x` shadows a previous, unrelated binding
209 --> $DIR/shadow.rs:47:20
210 |
211 LL | while let Some(x) = Some(1) {}
212 | ^
213 |
214 note: previous binding is here
215 --> $DIR/shadow.rs:38:9
216 |
217 LL | let x = 1;
218 | ^
219
220 error: `x` shadows a previous, unrelated binding
221 --> $DIR/shadow.rs:48:15
222 |
223 LL | let _ = |[x]: [u32; 1]| {
224 | ^
225 |
226 note: previous binding is here
227 --> $DIR/shadow.rs:38:9
228 |
229 LL | let x = 1;
230 | ^
231
232 error: `x` shadows a previous, unrelated binding
233 --> $DIR/shadow.rs:49:13
234 |
235 LL | let x = 1;
236 | ^
237 |
238 note: previous binding is here
239 --> $DIR/shadow.rs:48:15
240 |
241 LL | let _ = |[x]: [u32; 1]| {
242 | ^
243
244 error: `y` is shadowed
245 --> $DIR/shadow.rs:52:17
246 |
247 LL | if let Some(y) = y {}
248 | ^
249 |
250 note: previous binding is here
251 --> $DIR/shadow.rs:51:9
252 |
253 LL | let y = Some(1);
254 | ^
255
256 error: `_b` shadows a previous, unrelated binding
257 --> $DIR/shadow.rs:88:9
258 |
259 LL | let _b = _a;
260 | ^^
261 |
262 note: previous binding is here
263 --> $DIR/shadow.rs:87:28
264 |
265 LL | pub async fn foo2(_a: i32, _b: i64) {
266 | ^^
267
268 error: `x` shadows a previous, unrelated binding
269 --> $DIR/shadow.rs:94:21
270 |
271 LL | if let Some(x) = Some(1) { x } else { 1 }
272 | ^
273 |
274 note: previous binding is here
275 --> $DIR/shadow.rs:93:13
276 |
277 LL | let x = 1;
278 | ^
279
280 error: aborting due to 23 previous errors
281