rust/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs
2023-01-11 09:32:08 +00:00

13 lines
260 B
Rust

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]
}