1 error[E0308]: mismatched types
2 --> $DIR/ref-pat-suggestions.rs:3:8
4 LL | fn _f0(&_a: u32) {}
5 | ^^^ --- expected due to this
7 | expected `u32`, found reference
9 = note: expected type `u32`
11 help: to take parameter `_a` by reference, move `&` to the type
13 LL - fn _f0(&_a: u32) {}
14 LL + fn _f0(_a: &u32) {}
17 error[E0308]: mismatched types
18 --> $DIR/ref-pat-suggestions.rs:4:8
20 LL | fn _f1(&mut _a: u32) {}
21 | ^^^^^^^ --- expected due to this
23 | expected `u32`, found `&mut _`
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
30 LL | fn _f1(&mut _a: u32) {}
32 help: to take parameter `_a` by reference, move `&mut` to the type
34 LL - fn _f1(&mut _a: u32) {}
35 LL + fn _f1(_a: &mut u32) {}
38 error[E0308]: mismatched types
39 --> $DIR/ref-pat-suggestions.rs:5:9
41 LL | fn _f2(&&_a: &u32) {}
42 | ^^^ ---- expected due to this
44 | expected `u32`, found reference
46 = note: expected type `u32`
48 help: consider removing `&` from the pattern
50 LL - fn _f2(&&_a: &u32) {}
51 LL + fn _f2(&_a: &u32) {}
54 error[E0308]: mismatched types
55 --> $DIR/ref-pat-suggestions.rs:6:13
57 LL | fn _f3(&mut &_a: &mut u32) {}
58 | ^^^ -------- expected due to this
60 | expected `u32`, found reference
62 = note: expected type `u32`
64 help: consider removing `&` from the pattern
66 LL - fn _f3(&mut &_a: &mut u32) {}
67 LL + fn _f3(&mut _a: &mut u32) {}
70 error[E0308]: mismatched types
71 --> $DIR/ref-pat-suggestions.rs:7:9
73 LL | fn _f4(&&mut _a: &u32) {}
74 | ^^^^^^^ ---- expected due to this
76 | expected `u32`, found `&mut _`
78 = note: expected type `u32`
79 found mutable reference `&mut _`
80 help: consider removing `&mut` from the pattern
82 LL - fn _f4(&&mut _a: &u32) {}
83 LL + fn _f4(&_a: &u32) {}
86 error[E0308]: mismatched types
87 --> $DIR/ref-pat-suggestions.rs:8:13
89 LL | fn _f5(&mut &mut _a: &mut u32) {}
90 | ^^^^^^^ -------- expected due to this
92 | expected `u32`, found `&mut _`
94 = note: expected type `u32`
95 found mutable reference `&mut _`
96 help: consider removing `&mut` from the pattern
98 LL - fn _f5(&mut &mut _a: &mut u32) {}
99 LL + fn _f5(&mut _a: &mut u32) {}
102 error[E0308]: mismatched types
103 --> $DIR/ref-pat-suggestions.rs:11:23
105 LL | let _: fn(u32) = |&_a| ();
108 | |expected due to this
109 | expected `u32`, found reference
111 = note: expected type `u32`
113 help: consider removing `&` from the pattern
115 LL - let _: fn(u32) = |&_a| ();
116 LL + let _: fn(u32) = |_a| ();
119 error[E0308]: mismatched types
120 --> $DIR/ref-pat-suggestions.rs:12:23
122 LL | let _: fn(u32) = |&mut _a| ();
125 | | expected due to this
126 | expected `u32`, found `&mut _`
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
133 LL | let _: fn(u32) = |&mut _a| ();
135 help: consider removing `&mut` from the pattern
137 LL - let _: fn(u32) = |&mut _a| ();
138 LL + let _: fn(u32) = |_a| ();
141 error[E0308]: mismatched types
142 --> $DIR/ref-pat-suggestions.rs:13:25
144 LL | let _: fn(&u32) = |&&_a| ();
147 | |expected due to this
148 | expected `u32`, found reference
150 = note: expected type `u32`
152 help: consider removing `&` from the pattern
154 LL - let _: fn(&u32) = |&&_a| ();
155 LL + let _: fn(&u32) = |&_a| ();
158 error[E0308]: mismatched types
159 --> $DIR/ref-pat-suggestions.rs:14:33
161 LL | let _: fn(&mut u32) = |&mut &_a| ();
164 | |expected due to this
165 | expected `u32`, found reference
167 = note: expected type `u32`
169 help: consider removing `&` from the pattern
171 LL - let _: fn(&mut u32) = |&mut &_a| ();
172 LL + let _: fn(&mut u32) = |&mut _a| ();
175 error[E0308]: mismatched types
176 --> $DIR/ref-pat-suggestions.rs:15:25
178 LL | let _: fn(&u32) = |&&mut _a| ();
181 | | expected due to this
182 | expected `u32`, found `&mut _`
184 = note: expected type `u32`
185 found mutable reference `&mut _`
186 help: consider removing `&mut` from the pattern
188 LL - let _: fn(&u32) = |&&mut _a| ();
189 LL + let _: fn(&u32) = |&_a| ();
192 error[E0308]: mismatched types
193 --> $DIR/ref-pat-suggestions.rs:16:33
195 LL | let _: fn(&mut u32) = |&mut &mut _a| ();
198 | | expected due to this
199 | expected `u32`, found `&mut _`
201 = note: expected type `u32`
202 found mutable reference `&mut _`
203 help: consider removing `&mut` from the pattern
205 LL - let _: fn(&mut u32) = |&mut &mut _a| ();
206 LL + let _: fn(&mut u32) = |&mut _a| ();
209 error[E0308]: mismatched types
210 --> $DIR/ref-pat-suggestions.rs:18:14
212 LL | let _ = |&_a: u32| ();
213 | ^^^ --- expected due to this
215 | expected `u32`, found reference
217 = note: expected type `u32`
219 help: to take parameter `_a` by reference, move `&` to the type
221 LL - let _ = |&_a: u32| ();
222 LL + let _ = |_a: &u32| ();
225 error[E0308]: mismatched types
226 --> $DIR/ref-pat-suggestions.rs:19:14
228 LL | let _ = |&mut _a: u32| ();
229 | ^^^^^^^ --- expected due to this
231 | expected `u32`, found `&mut _`
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
238 LL | let _ = |&mut _a: u32| ();
240 help: to take parameter `_a` by reference, move `&mut` to the type
242 LL - let _ = |&mut _a: u32| ();
243 LL + let _ = |_a: &mut u32| ();
246 error[E0308]: mismatched types
247 --> $DIR/ref-pat-suggestions.rs:20:15
249 LL | let _ = |&&_a: &u32| ();
250 | ^^^ ---- expected due to this
252 | expected `u32`, found reference
254 = note: expected type `u32`
256 help: consider removing `&` from the pattern
258 LL - let _ = |&&_a: &u32| ();
259 LL + let _ = |&_a: &u32| ();
262 error[E0308]: mismatched types
263 --> $DIR/ref-pat-suggestions.rs:21:19
265 LL | let _ = |&mut &_a: &mut u32| ();
266 | ^^^ -------- expected due to this
268 | expected `u32`, found reference
270 = note: expected type `u32`
272 help: consider removing `&` from the pattern
274 LL - let _ = |&mut &_a: &mut u32| ();
275 LL + let _ = |&mut _a: &mut u32| ();
278 error[E0308]: mismatched types
279 --> $DIR/ref-pat-suggestions.rs:22:15
281 LL | let _ = |&&mut _a: &u32| ();
282 | ^^^^^^^ ---- expected due to this
284 | expected `u32`, found `&mut _`
286 = note: expected type `u32`
287 found mutable reference `&mut _`
288 help: consider removing `&mut` from the pattern
290 LL - let _ = |&&mut _a: &u32| ();
291 LL + let _ = |&_a: &u32| ();
294 error[E0308]: mismatched types
295 --> $DIR/ref-pat-suggestions.rs:23:19
297 LL | let _ = |&mut &mut _a: &mut u32| ();
298 | ^^^^^^^ -------- expected due to this
300 | expected `u32`, found `&mut _`
302 = note: expected type `u32`
303 found mutable reference `&mut _`
304 help: consider removing `&mut` from the pattern
306 LL - let _ = |&mut &mut _a: &mut u32| ();
307 LL + let _ = |&mut _a: &mut u32| ();
310 error[E0308]: mismatched types
311 --> $DIR/ref-pat-suggestions.rs:29:13
313 LL | let &mut _a = 0;
314 | ^^^^^^^ - this expression has type `{integer}`
316 | expected integer, found `&mut _`
317 | help: to declare a mutable variable use: `mut _a`
319 = note: expected type `{integer}`
320 found mutable reference `&mut _`
322 error[E0308]: mismatched types
323 --> $DIR/ref-pat-suggestions.rs:30:15
325 LL | let S(&mut _b) = S(0);
326 | ^^^^^^^ ---- this expression has type `S`
328 | expected `u8`, found `&mut _`
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
335 LL | let S(&mut _b) = S(0);
337 help: consider removing `&mut` from the pattern
339 LL - let S(&mut _b) = S(0);
340 LL + let S(_b) = S(0);
343 error[E0308]: mismatched types
344 --> $DIR/ref-pat-suggestions.rs:31:14
346 LL | let (&mut _c,) = (0,);
347 | ^^^^^^^ ---- this expression has type `({integer},)`
349 | expected integer, found `&mut _`
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
356 LL | let (&mut _c,) = (0,);
358 help: consider removing `&mut` from the pattern
360 LL - let (&mut _c,) = (0,);
361 LL + let (_c,) = (0,);
364 error[E0308]: mismatched types
365 --> $DIR/ref-pat-suggestions.rs:34:13
368 | - this expression has type `{integer}`
370 | ^^^^^^^ expected integer, found `&mut _`
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
379 help: consider removing `&mut` from the pattern
385 error: aborting due to 22 previous errors
387 For more information about this error, try `rustc --explain E0308`.