From 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:39 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/box/unit/unique-swap.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 tests/ui/box/unit/unique-swap.rs (limited to 'tests/ui/box/unit/unique-swap.rs') diff --git a/tests/ui/box/unit/unique-swap.rs b/tests/ui/box/unit/unique-swap.rs new file mode 100644 index 000000000..4f33ff9a8 --- /dev/null +++ b/tests/ui/box/unit/unique-swap.rs @@ -0,0 +1,11 @@ +// run-pass + +use std::mem::swap; + +pub fn main() { + let mut i: Box<_> = Box::new(100); + let mut j: Box<_> = Box::new(200); + swap(&mut i, &mut j); + assert_eq!(i, Box::new(200)); + assert_eq!(j, Box::new(100)); +} -- cgit v1.2.3