mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 01:04:03 +00:00
12 lines
224 B
Rust
12 lines
224 B
Rust
// 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));
|
|
}
|