]> git.lizzy.rs Git - rust.git/blob - tests/ui/pattern/issue-74539.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / pattern / issue-74539.stderr
1 error: `x @` is not allowed in a tuple struct
2   --> $DIR/issue-74539.rs:8:14
3    |
4 LL |         E::A(x @ ..) => {
5    |              ^^^^^^ this is only allowed in slice patterns
6    |
7    = help: remove this and bind each tuple field independently
8 help: if you don't need to use the contents of x, discard the tuple's remaining fields
9    |
10 LL |         E::A(..) => {
11    |              ~~
12
13 error: `..` patterns are not allowed here
14   --> $DIR/issue-74539.rs:8:18
15    |
16 LL |         E::A(x @ ..) => {
17    |                  ^^
18    |
19    = note: only allowed in tuple, tuple struct, and slice patterns
20
21 error[E0023]: this pattern has 1 field, but the corresponding tuple variant has 2 fields
22   --> $DIR/issue-74539.rs:8:14
23    |
24 LL |     A(u8, u8),
25    |       --  -- tuple variant has 2 fields
26 ...
27 LL |         E::A(x @ ..) => {
28    |              ^^^^^^ expected 2 fields, found 1
29    |
30 help: use `_` to explicitly ignore each field
31    |
32 LL |         E::A(x @ .., _) => {
33    |                    +++
34
35 error: aborting due to 3 previous errors
36
37 For more information about this error, try `rustc --explain E0023`.