File tree 1 file changed +28
-1
lines changed
1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -286,6 +286,34 @@ fn main() {
286
286
```
287
287
"## ,
288
288
289
+ E0561 : r##"
290
+ A non-ident or non-wildcard pattern has been used as a parameter of a function
291
+ pointer type.
292
+
293
+ Erroneous code example:
294
+
295
+ ```compile_fail,E0561
296
+ type A1 = fn(mut param: u8); // error!
297
+ type A2 = fn(¶m: u32); // error!
298
+ ```
299
+
300
+ When using an alias over a function type, you cannot e.g. denote a parameter as
301
+ being mutable.
302
+
303
+ To fix the issue, remove patterns (`_` is allowed though). Example:
304
+
305
+ ```
306
+ type A1 = fn(param: u8); // ok!
307
+ type A2 = fn(_: u32); // ok!
308
+ ```
309
+
310
+ You can also omit the parameter name:
311
+
312
+ ```
313
+ type A3 = fn(i16); // ok!
314
+ ```
315
+ "## ,
316
+
289
317
E0571 : r##"
290
318
A `break` statement with an argument appeared in a non-`loop` loop.
291
319
@@ -503,7 +531,6 @@ Switch to the Rust 2018 edition to use `async fn`.
503
531
;
504
532
E0226 , // only a single explicit lifetime bound is permitted
505
533
E0472 , // asm! is unsupported on this target
506
- E0561 , // patterns aren't allowed in function pointer types
507
534
E0567 , // auto traits can not have generic parameters
508
535
E0568 , // auto traits can not have super traits
509
536
E0666 , // nested `impl Trait` is illegal
You can’t perform that action at this time.
0 commit comments