Files
rust/tests/ui/pattern/struct-variant-as-tuple-variant.rs
2026-06-06 21:02:15 +02:00

16 lines
327 B
Rust

//! Regression test for <https://github.com/rust-lang/rust/issues/19086>.
use Foo::FooB;
enum Foo {
FooB { x: i32, y: i32 }
}
fn main() {
let f = FooB { x: 3, y: 4 };
match f {
FooB(a, b) => println!("{} {}", a, b),
//~^ ERROR expected tuple struct or tuple variant, found variant `FooB`
}
}