summaryrefslogtreecommitdiffstats
path: root/tests/ui/box/unit/unique-destructure.rs
blob: 7207ac962953ebc53ac3764c4348dc76dcc11917 (plain)
1
2
3
4
5
6
7
8
9
// 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);
}