summaryrefslogtreecommitdiffstats
path: root/tests/ui/pattern/incorrect-placement-of-pattern-modifiers.rs
blob: 98772c1188ed4facd6b6ab2062f4f46050aff468 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// run-rustfix
struct S {
    field_name: (),
}

fn main() {
    match (S {field_name: ()}) {
        S {ref field_name: _foo} => {} //~ ERROR expected `,`
    }
    match (S {field_name: ()}) {
        S {mut field_name: _foo} => {} //~ ERROR expected `,`
    }
    match (S {field_name: ()}) {
        S {ref mut field_name: _foo} => {} //~ ERROR expected `,`
    }
    // Verify that we recover enough to run typeck.
    let _: usize = 3u8; //~ ERROR mismatched types
}