1 // aux-build:declarations-for-tuple-field-count-errors.rs
3 extern crate declarations_for_tuple_field_count_errors;
5 use declarations_for_tuple_field_count_errors::*;
9 Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0`
10 Z0(x) => {} //~ ERROR expected tuple struct or tuple variant, found unit struct `Z0`
13 Z1 => {} //~ ERROR match bindings cannot shadow tuple structs
14 Z1(x) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 0 fields
18 S() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple struct has 3 fields
19 S(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 3 fields
20 S(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple struct has 3 fields
21 S(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields
24 M() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple struct has 3 fields
25 M(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple struct has 3 fields
26 M(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple struct has 3 fields
27 M(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields
31 E1::Z0() => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0`
32 E1::Z0(x) => {} //~ ERROR expected tuple struct or tuple variant, found unit variant `E1::Z0`
35 E1::Z1 => {} //~ ERROR expected unit struct, unit variant or constant, found tuple variant `E1::Z1`
36 E1::Z1(x) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 0 fields
38 match E1::S(1, 2, 3) {
39 E1::S() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple variant has 3 fields
40 E1::S(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 3 fields
41 E1::S(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3 fields
42 E1::S(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple variant has 3 fields
45 match E2::S(1, 2, 3) {
46 E2::S() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple variant has 3 fields
47 E2::S(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 3 fields
48 E2::S(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3 fields
49 E2::S(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple variant has 3 fields
51 match E2::M(1, 2, 3) {
52 E2::M() => {} //~ ERROR this pattern has 0 fields, but the corresponding tuple variant has 3 fields
53 E2::M(1) => {} //~ ERROR this pattern has 1 field, but the corresponding tuple variant has 3 fields
54 E2::M(xyz, abc) => {} //~ ERROR this pattern has 2 fields, but the corresponding tuple variant has 3 fields
55 E2::M(1, 2, 3, 4) => {} //~ ERROR this pattern has 4 fields, but the corresponding tuple variant has 3 fields