rust/tests/ui/box/unit/unique-destructure.rs
2024-02-16 20:02:50 +00:00

10 lines
181 B
Rust

//@ run-pass
#![feature(box_patterns)]
struct Foo { a: isize, b: isize }
pub fn main() {
let box Foo{ a, b } = Box::new(Foo { a: 100, b: 200 });
assert_eq!(a + b, 300);
}