rust/tests/ui/structs-enums/tuple-struct-matching.rs
2023-01-11 09:32:08 +00:00

14 lines
230 B
Rust

// run-pass
struct Foo(isize, isize);
pub fn main() {
let x = Foo(1, 2);
match x {
Foo(a, b) => {
assert_eq!(a, 1);
assert_eq!(b, 2);
println!("{} {}", a, b);
}
}
}