summary refs log tree commit diff
path: root/src/test/ui/pattern/pat-tuple-overfield.rs
blob: 46a5e15ffa52cc124a74a1e3868d532d6ac22518 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
struct S(u8, u8, u8);

fn main() {
    match (1, 2, 3) {
        (1, 2, 3, 4) => {} //~ ERROR mismatched types
        (1, 2, .., 3, 4) => {} //~ ERROR mismatched types
        _ => {}
    }
    match S(1, 2, 3) {
        S(1, 2, 3, 4) => {}
        //~^ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields
        S(1, 2, .., 3, 4) => {}
        //~^ ERROR this pattern has 4 fields, but the corresponding tuple struct has 3 fields
        _ => {}
    }
}