about summary refs log tree commit diff
path: root/src/test/ui/pattern/pat-tuple-overfield.stderr
blob: 45b6fd1b4d445e97c662ab9ac0a01ed49072bd25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
error[E0308]: mismatched types
  --> $DIR/pat-tuple-overfield.rs:5:9
   |
LL |     match (1, 2, 3) {
   |           --------- this expression has type `({integer}, {integer}, {integer})`
LL |         (1, 2, 3, 4) => {}
   |         ^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
   |
   = note: expected tuple `({integer}, {integer}, {integer})`
              found tuple `(_, _, _, _)`

error[E0308]: mismatched types
  --> $DIR/pat-tuple-overfield.rs:6:9
   |
LL |     match (1, 2, 3) {
   |           --------- this expression has type `({integer}, {integer}, {integer})`
LL |         (1, 2, 3, 4) => {}
LL |         (1, 2, .., 3, 4) => {}
   |         ^^^^^^^^^^^^^^^^ expected a tuple with 3 elements, found one with 4 elements
   |
   = note: expected tuple `({integer}, {integer}, {integer})`
              found tuple `(_, _, _, _)`

error[E0023]: this pattern has 4 fields, but the corresponding tuple struct has 3 fields
  --> $DIR/pat-tuple-overfield.rs:10:9
   |
LL | struct S(u8, u8, u8);
   | --------------------- tuple struct defined here
...
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
  --> $DIR/pat-tuple-overfield.rs:12:9
   |
LL | struct S(u8, u8, u8);
   | --------------------- tuple struct defined here
...
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.
For more information about an error, try `rustc --explain E0023`.