summaryrefslogtreecommitdiffstats
path: root/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs
blob: c30b8a1e1f1a7c3bd74f599c7f7e3feae8d87e5f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
enum Foo {
    Bar { bar: bool },
    Other,
}

fn main() {
    let foo = Some(Foo::Other);

    if let Some(Foo::Bar {_}) = foo {}
    //~^ ERROR expected identifier, found reserved identifier `_`
    //~| ERROR pattern does not mention field `bar` [E0027]
}