blob: 4f33ff9a8a35e7fdb1a2364a3908e4dbd115f2d5 (
plain)
1
2
3
4
5
6
7
8
9
10
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));
}
|