]>
Commit | Line | Data |
---|---|---|
60c5eb7d XL |
1 | A non-ident or non-wildcard pattern has been used as a parameter of a function |
2 | pointer type. | |
3 | ||
4 | Erroneous code example: | |
5 | ||
6 | ```compile_fail,E0561 | |
7 | type A1 = fn(mut param: u8); // error! | |
8 | type A2 = fn(¶m: u32); // error! | |
9 | ``` | |
10 | ||
11 | When using an alias over a function type, you cannot e.g. denote a parameter as | |
12 | being mutable. | |
13 | ||
14 | To fix the issue, remove patterns (`_` is allowed though). Example: | |
15 | ||
16 | ``` | |
17 | type A1 = fn(param: u8); // ok! | |
18 | type A2 = fn(_: u32); // ok! | |
19 | ``` | |
20 | ||
21 | You can also omit the parameter name: | |
22 | ||
23 | ``` | |
24 | type A3 = fn(i16); // ok! | |
25 | ``` |