]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs
Rollup merge of #105843 - compiler-errors:sugg-const, r=lcnr
[rust.git] / src / test / ui / structs-enums / struct-enum-ignoring-field-with-underscore.rs
1 enum Foo {
2     Bar { bar: bool },
3     Other,
4 }
5
6 fn main() {
7     let foo = Some(Foo::Other);
8
9     if let Some(Foo::Bar {_}) = foo {}
10     //~^ ERROR expected identifier, found reserved identifier `_`
11     //~| ERROR pattern does not mention field `bar` [E0027]
12 }