rust/tests/ui/pattern/issue-74539.rs

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

16 lines
357 B
Rust
Raw Normal View History

2020-07-30 17:19:49 -05:00
enum E {
A(u8, u8),
}
fn main() {
let e = E::A(2, 3);
match e {
E::A(x @ ..) => {
//~^ ERROR: `x @` is not allowed in a tuple struct
//~| ERROR: `..` patterns are not allowed here
//~| ERROR: this pattern has 1 field, but the corresponding tuple variant has 2 fields
x
}
};
}