From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/box/unit/unique-destructure.rs | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/ui/box/unit/unique-destructure.rs (limited to 'tests/ui/box/unit/unique-destructure.rs') diff --git a/tests/ui/box/unit/unique-destructure.rs b/tests/ui/box/unit/unique-destructure.rs new file mode 100644 index 000000000..7207ac962 --- /dev/null +++ b/tests/ui/box/unit/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); +} -- cgit v1.2.3