diff options
Diffstat (limited to 'tests/ui/unique/unique-destructure.rs')
-rw-r--r-- | tests/ui/unique/unique-destructure.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/ui/unique/unique-destructure.rs b/tests/ui/unique/unique-destructure.rs new file mode 100644 index 000000000..7207ac962 --- /dev/null +++ b/tests/ui/unique/unique-destructure.rs @@ -0,0 +1,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); +} |