]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0642.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0642.md
CommitLineData
60c5eb7d
XL
1Trait methods currently cannot take patterns as arguments.
2
f035d41b 3Erroneous code example:
60c5eb7d
XL
4
5```compile_fail,E0642
6trait Foo {
7 fn foo((x, y): (i32, i32)); // error: patterns aren't allowed
8 // in trait methods
9}
10```
11
12You can instead use a single name for the argument:
13
14```
15trait Foo {
16 fn foo(x_and_y: (i32, i32)); // ok!
17}
18```