fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #71365 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4fb7144ed15

1.43.0
1.6 KiB45 linesraw
1error[E0308]: mismatched types
2  --> $DIR/pat-tuple-overfield.rs:5:9
3   |
4LL |     match (1, 2, 3) {
5   |           --------- this expression has type `({integer}, {integer}, {integer})`
6LL |         (1, 2, 3, 4) => {}
7   |         ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
8   |
9   = note: expected tuple `({integer}, {integer}, {integer})`
10              found tuple `(_, _, _, _)`
11
12error[E0308]: mismatched types
13  --> $DIR/pat-tuple-overfield.rs:6:9
14   |
15LL |     match (1, 2, 3) {
16   |           --------- this expression has type `({integer}, {integer}, {integer})`
17LL |         (1, 2, 3, 4) => {}
18LL |         (1, 2, .., 3, 4) => {}
19   |         ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
20   |
21   = note: expected tuple `({integer}, {integer}, {integer})`
22              found tuple `(_, _, _, _)`
23
24error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
25  --> $DIR/pat-tuple-overfield.rs:10:9
26   |
27LL | struct S(u8, u8, u8);
28   | --------------------- tuple struct defined here
29...
30LL |         S(1, 2, 3, 4) => {}
31   |         ^^^^^^^^^^^^^ expected 3 fields, found 4
32
33error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
34  --> $DIR/pat-tuple-overfield.rs:12:9
35   |
36LL | struct S(u8, u8, u8);
37   | --------------------- tuple struct defined here
38...
39LL |         S(1, 2, .., 3, 4) => {}
40   |         ^^^^^^^^^^^^^^^^^ expected 3 fields, found 4
41
42error: aborting due to 4 previous errors
43
44Some errors have detailed explanations: E0023, E0308.
45For more information about an error, try `rustc --explain E0023`.