Files
rust/src/test/ui/pattern/pat-tuple-overfield.stderr

46 lines
1.6 KiB
Plaintext
Raw Normal View History

2018-08-08 14:28:26 +02:00
error[E0308]: mismatched types
2018-12-25 08:56:47 -07:00
--> $DIR/pat-tuple-overfield.rs:5:9
2018-08-08 14:28:26 +02:00
|
2020-02-25 05:46:58 +01:00
LL | match (1, 2, 3) {
| --------- this expression has type `({integer}, {integer}, {integer})`
2019-03-09 15:03:44 +03:00
LL | (1, 2, 3, 4) => {}
2018-08-08 14:28:26 +02:00
| ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
|
= note: expected tuple `({integer}, {integer}, {integer})`
found tuple `(_, _, _, _)`
2018-08-08 14:28:26 +02:00
error[E0308]: mismatched types
2018-12-25 08:56:47 -07:00
--> $DIR/pat-tuple-overfield.rs:6:9
2018-08-08 14:28:26 +02:00
|
2020-02-25 05:46:58 +01:00
LL | match (1, 2, 3) {
| --------- this expression has type `({integer}, {integer}, {integer})`
LL | (1, 2, 3, 4) => {}
2019-03-09 15:03:44 +03:00
LL | (1, 2, .., 3, 4) => {}
2018-08-08 14:28:26 +02:00
| ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
|
= note: expected tuple `({integer}, {integer}, {integer})`
found tuple `(_, _, _, _)`
2018-08-08 14:28:26 +02:00
error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
2018-12-25 08:56:47 -07:00
--> $DIR/pat-tuple-overfield.rs:10:9
2018-08-08 14:28:26 +02:00
|
LL | struct S(u8, u8, u8);
| --------------------- tuple struct defined here
...
2018-08-08 14:28:26 +02:00
LL | S(1, 2, 3, 4) => {}
| ^^^^^^^^^^^^^ expected 3 fields, found 4
error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
2018-12-25 08:56:47 -07:00
--> $DIR/pat-tuple-overfield.rs:12:9
2018-08-08 14:28:26 +02:00
|
LL | struct S(u8, u8, u8);
| --------------------- tuple struct defined here
...
2018-08-08 14:28:26 +02:00
LL | S(1, 2, .., 3, 4) => {}
| ^^^^^^^^^^^^^^^^^ expected 3 fields, found 4
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0023, E0308.
2018-08-08 14:28:26 +02:00
For more information about an error, try `rustc --explain E0023`.