mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-29 19:47:38 +00:00

Done with ```bash sd '//@ pretty-expanded.*\n' '' tests/ui/**/*.rs ``` and ``` sd '//@pretty-expanded.*\n' '' tests/ui/**/*.rs ```
13 lines
200 B
Rust
13 lines
200 B
Rust
//@ run-pass
|
|
|
|
pub fn main() {
|
|
use std::mem::replace;
|
|
let mut x = 5;
|
|
let _ = replace(&mut x, 6);
|
|
{
|
|
use std::mem::*;
|
|
let mut y = 6;
|
|
swap(&mut x, &mut y);
|
|
}
|
|
}
|