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