fork/rust

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

borsAuto merge of #67350 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum73528e339aa

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