about summary refs log tree commit diff
path: root/tests/ui/unique/unique-swap.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/unique/unique-swap.rs')
-rw-r--r--tests/ui/unique/unique-swap.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/unique/unique-swap.rs b/tests/ui/unique/unique-swap.rs
new file mode 100644
index 00000000000..4f33ff9a8a3
--- /dev/null
+++ b/tests/ui/unique/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));
+}