rust/tests/ui/structs-enums/struct-enum-ignoring-field-with-underscore.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
260 B
Rust
Raw Normal View History

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