]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mismatched_types/ref-pat-suggestions.stderr
Rollup merge of #98640 - cuviper:stable-rust-analyzer, r=Mark-Simulacrum
[rust.git] / src / test / ui / mismatched_types / ref-pat-suggestions.stderr
1 error[E0308]: mismatched types
2   --> $DIR/ref-pat-suggestions.rs:3:8
3    |
4 LL | fn _f0(&_a: u32) {}
5    |        ^^^  --- expected due to this
6    |        |
7    |        expected `u32`, found reference
8    |
9    = note:   expected type `u32`
10            found reference `&_`
11 help: to take parameter `_a` by reference, move `&` to the type
12    |
13 LL - fn _f0(&_a: u32) {}
14 LL + fn _f0(_a: &u32) {}
15    |
16
17 error[E0308]: mismatched types
18   --> $DIR/ref-pat-suggestions.rs:4:8
19    |
20 LL | fn _f1(&mut _a: u32) {}
21    |        ^^^^^^^  --- expected due to this
22    |        |
23    |        expected `u32`, found `&mut _`
24    |
25    = note:           expected type `u32`
26            found mutable reference `&mut _`
27 note: to declare a mutable parameter use: `mut _a`
28   --> $DIR/ref-pat-suggestions.rs:4:8
29    |
30 LL | fn _f1(&mut _a: u32) {}
31    |        ^^^^^^^
32 help: to take parameter `_a` by reference, move `&mut` to the type
33    |
34 LL - fn _f1(&mut _a: u32) {}
35 LL + fn _f1(_a: &mut u32) {}
36    |
37
38 error[E0308]: mismatched types
39   --> $DIR/ref-pat-suggestions.rs:5:9
40    |
41 LL | fn _f2(&&_a: &u32) {}
42    |         ^^^  ---- expected due to this
43    |         |
44    |         expected `u32`, found reference
45    |
46    = note:   expected type `u32`
47            found reference `&_`
48 help: consider removing `&` from the pattern
49    |
50 LL - fn _f2(&&_a: &u32) {}
51 LL + fn _f2(&_a: &u32) {}
52    |
53
54 error[E0308]: mismatched types
55   --> $DIR/ref-pat-suggestions.rs:6:13
56    |
57 LL | fn _f3(&mut &_a: &mut u32) {}
58    |             ^^^  -------- expected due to this
59    |             |
60    |             expected `u32`, found reference
61    |
62    = note:   expected type `u32`
63            found reference `&_`
64 help: consider removing `&` from the pattern
65    |
66 LL - fn _f3(&mut &_a: &mut u32) {}
67 LL + fn _f3(&mut _a: &mut u32) {}
68    |
69
70 error[E0308]: mismatched types
71   --> $DIR/ref-pat-suggestions.rs:7:9
72    |
73 LL | fn _f4(&&mut _a: &u32) {}
74    |         ^^^^^^^  ---- expected due to this
75    |         |
76    |         expected `u32`, found `&mut _`
77    |
78    = note:           expected type `u32`
79            found mutable reference `&mut _`
80 help: consider removing `&mut` from the pattern
81    |
82 LL - fn _f4(&&mut _a: &u32) {}
83 LL + fn _f4(&_a: &u32) {}
84    |
85
86 error[E0308]: mismatched types
87   --> $DIR/ref-pat-suggestions.rs:8:13
88    |
89 LL | fn _f5(&mut &mut _a: &mut u32) {}
90    |             ^^^^^^^  -------- expected due to this
91    |             |
92    |             expected `u32`, found `&mut _`
93    |
94    = note:           expected type `u32`
95            found mutable reference `&mut _`
96 help: consider removing `&mut` from the pattern
97    |
98 LL - fn _f5(&mut &mut _a: &mut u32) {}
99 LL + fn _f5(&mut _a: &mut u32) {}
100    |
101
102 error[E0308]: mismatched types
103   --> $DIR/ref-pat-suggestions.rs:11:23
104    |
105 LL |     let _: fn(u32) = |&_a| ();
106    |                       ^--
107    |                       ||
108    |                       |expected due to this
109    |                       expected `u32`, found reference
110    |
111    = note:   expected type `u32`
112            found reference `&_`
113 help: consider removing `&` from the pattern
114    |
115 LL -     let _: fn(u32) = |&_a| ();
116 LL +     let _: fn(u32) = |_a| ();
117    |
118
119 error[E0308]: mismatched types
120   --> $DIR/ref-pat-suggestions.rs:12:23
121    |
122 LL |     let _: fn(u32) = |&mut _a| ();
123    |                       ^^^^^--
124    |                       |    |
125    |                       |    expected due to this
126    |                       expected `u32`, found `&mut _`
127    |
128    = note:           expected type `u32`
129            found mutable reference `&mut _`
130 note: to declare a mutable parameter use: `mut _a`
131   --> $DIR/ref-pat-suggestions.rs:12:23
132    |
133 LL |     let _: fn(u32) = |&mut _a| ();
134    |                       ^^^^^^^
135 help: consider removing `&mut` from the pattern
136    |
137 LL -     let _: fn(u32) = |&mut _a| ();
138 LL +     let _: fn(u32) = |_a| ();
139    |
140
141 error[E0308]: mismatched types
142   --> $DIR/ref-pat-suggestions.rs:13:25
143    |
144 LL |     let _: fn(&u32) = |&&_a| ();
145    |                         ^--
146    |                         ||
147    |                         |expected due to this
148    |                         expected `u32`, found reference
149    |
150    = note:   expected type `u32`
151            found reference `&_`
152 help: consider removing `&` from the pattern
153    |
154 LL -     let _: fn(&u32) = |&&_a| ();
155 LL +     let _: fn(&u32) = |&_a| ();
156    |
157
158 error[E0308]: mismatched types
159   --> $DIR/ref-pat-suggestions.rs:14:33
160    |
161 LL |     let _: fn(&mut u32) = |&mut &_a| ();
162    |                                 ^--
163    |                                 ||
164    |                                 |expected due to this
165    |                                 expected `u32`, found reference
166    |
167    = note:   expected type `u32`
168            found reference `&_`
169 help: consider removing `&` from the pattern
170    |
171 LL -     let _: fn(&mut u32) = |&mut &_a| ();
172 LL +     let _: fn(&mut u32) = |&mut _a| ();
173    |
174
175 error[E0308]: mismatched types
176   --> $DIR/ref-pat-suggestions.rs:15:25
177    |
178 LL |     let _: fn(&u32) = |&&mut _a| ();
179    |                         ^^^^^--
180    |                         |    |
181    |                         |    expected due to this
182    |                         expected `u32`, found `&mut _`
183    |
184    = note:           expected type `u32`
185            found mutable reference `&mut _`
186 help: consider removing `&mut` from the pattern
187    |
188 LL -     let _: fn(&u32) = |&&mut _a| ();
189 LL +     let _: fn(&u32) = |&_a| ();
190    |
191
192 error[E0308]: mismatched types
193   --> $DIR/ref-pat-suggestions.rs:16:33
194    |
195 LL |     let _: fn(&mut u32) = |&mut &mut _a| ();
196    |                                 ^^^^^--
197    |                                 |    |
198    |                                 |    expected due to this
199    |                                 expected `u32`, found `&mut _`
200    |
201    = note:           expected type `u32`
202            found mutable reference `&mut _`
203 help: consider removing `&mut` from the pattern
204    |
205 LL -     let _: fn(&mut u32) = |&mut &mut _a| ();
206 LL +     let _: fn(&mut u32) = |&mut _a| ();
207    |
208
209 error[E0308]: mismatched types
210   --> $DIR/ref-pat-suggestions.rs:18:14
211    |
212 LL |     let _ = |&_a: u32| ();
213    |              ^^^  --- expected due to this
214    |              |
215    |              expected `u32`, found reference
216    |
217    = note:   expected type `u32`
218            found reference `&_`
219 help: to take parameter `_a` by reference, move `&` to the type
220    |
221 LL -     let _ = |&_a: u32| ();
222 LL +     let _ = |_a: &u32| ();
223    |
224
225 error[E0308]: mismatched types
226   --> $DIR/ref-pat-suggestions.rs:19:14
227    |
228 LL |     let _ = |&mut _a: u32| ();
229    |              ^^^^^^^  --- expected due to this
230    |              |
231    |              expected `u32`, found `&mut _`
232    |
233    = note:           expected type `u32`
234            found mutable reference `&mut _`
235 note: to declare a mutable parameter use: `mut _a`
236   --> $DIR/ref-pat-suggestions.rs:19:14
237    |
238 LL |     let _ = |&mut _a: u32| ();
239    |              ^^^^^^^
240 help: to take parameter `_a` by reference, move `&mut` to the type
241    |
242 LL -     let _ = |&mut _a: u32| ();
243 LL +     let _ = |_a: &mut u32| ();
244    |
245
246 error[E0308]: mismatched types
247   --> $DIR/ref-pat-suggestions.rs:20:15
248    |
249 LL |     let _ = |&&_a: &u32| ();
250    |               ^^^  ---- expected due to this
251    |               |
252    |               expected `u32`, found reference
253    |
254    = note:   expected type `u32`
255            found reference `&_`
256 help: consider removing `&` from the pattern
257    |
258 LL -     let _ = |&&_a: &u32| ();
259 LL +     let _ = |&_a: &u32| ();
260    |
261
262 error[E0308]: mismatched types
263   --> $DIR/ref-pat-suggestions.rs:21:19
264    |
265 LL |     let _ = |&mut &_a: &mut u32| ();
266    |                   ^^^  -------- expected due to this
267    |                   |
268    |                   expected `u32`, found reference
269    |
270    = note:   expected type `u32`
271            found reference `&_`
272 help: consider removing `&` from the pattern
273    |
274 LL -     let _ = |&mut &_a: &mut u32| ();
275 LL +     let _ = |&mut _a: &mut u32| ();
276    |
277
278 error[E0308]: mismatched types
279   --> $DIR/ref-pat-suggestions.rs:22:15
280    |
281 LL |     let _ = |&&mut _a: &u32| ();
282    |               ^^^^^^^  ---- expected due to this
283    |               |
284    |               expected `u32`, found `&mut _`
285    |
286    = note:           expected type `u32`
287            found mutable reference `&mut _`
288 help: consider removing `&mut` from the pattern
289    |
290 LL -     let _ = |&&mut _a: &u32| ();
291 LL +     let _ = |&_a: &u32| ();
292    |
293
294 error[E0308]: mismatched types
295   --> $DIR/ref-pat-suggestions.rs:23:19
296    |
297 LL |     let _ = |&mut &mut _a: &mut u32| ();
298    |                   ^^^^^^^  -------- expected due to this
299    |                   |
300    |                   expected `u32`, found `&mut _`
301    |
302    = note:           expected type `u32`
303            found mutable reference `&mut _`
304 help: consider removing `&mut` from the pattern
305    |
306 LL -     let _ = |&mut &mut _a: &mut u32| ();
307 LL +     let _ = |&mut _a: &mut u32| ();
308    |
309
310 error[E0308]: mismatched types
311   --> $DIR/ref-pat-suggestions.rs:29:13
312    |
313 LL |         let &mut _a = 0;
314    |             ^^^^^^^   - this expression has type `{integer}`
315    |             |
316    |             expected integer, found `&mut _`
317    |             help: to declare a mutable variable use: `mut _a`
318    |
319    = note:           expected type `{integer}`
320            found mutable reference `&mut _`
321
322 error[E0308]: mismatched types
323   --> $DIR/ref-pat-suggestions.rs:30:15
324    |
325 LL |         let S(&mut _b) = S(0);
326    |               ^^^^^^^    ---- this expression has type `S`
327    |               |
328    |               expected `u8`, found `&mut _`
329    |
330    = note:           expected type `u8`
331            found mutable reference `&mut _`
332 note: to declare a mutable binding use: `mut _b`
333   --> $DIR/ref-pat-suggestions.rs:30:15
334    |
335 LL |         let S(&mut _b) = S(0);
336    |               ^^^^^^^
337 help: consider removing `&mut` from the pattern
338    |
339 LL -         let S(&mut _b) = S(0);
340 LL +         let S(_b) = S(0);
341    |
342
343 error[E0308]: mismatched types
344   --> $DIR/ref-pat-suggestions.rs:31:14
345    |
346 LL |         let (&mut _c,) = (0,);
347    |              ^^^^^^^     ---- this expression has type `({integer},)`
348    |              |
349    |              expected integer, found `&mut _`
350    |
351    = note:           expected type `{integer}`
352            found mutable reference `&mut _`
353 note: to declare a mutable binding use: `mut _c`
354   --> $DIR/ref-pat-suggestions.rs:31:14
355    |
356 LL |         let (&mut _c,) = (0,);
357    |              ^^^^^^^
358 help: consider removing `&mut` from the pattern
359    |
360 LL -         let (&mut _c,) = (0,);
361 LL +         let (_c,) = (0,);
362    |
363
364 error[E0308]: mismatched types
365   --> $DIR/ref-pat-suggestions.rs:34:13
366    |
367 LL |         match 0 {
368    |               - this expression has type `{integer}`
369 LL |             &mut _d => {}
370    |             ^^^^^^^ expected integer, found `&mut _`
371    |
372    = note:           expected type `{integer}`
373            found mutable reference `&mut _`
374 note: to declare a mutable binding use: `mut _d`
375   --> $DIR/ref-pat-suggestions.rs:34:13
376    |
377 LL |             &mut _d => {}
378    |             ^^^^^^^
379 help: consider removing `&mut` from the pattern
380    |
381 LL -             &mut _d => {}
382 LL +             _d => {}
383    |
384
385 error: aborting due to 22 previous errors
386
387 For more information about this error, try `rustc --explain E0308`.