mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
13 lines
251 B
Rust
13 lines
251 B
Rust
// unit-test: RenameReturnPlace
|
|
|
|
// EMIT_MIR nrvo_simple.nrvo.RenameReturnPlace.diff
|
|
fn nrvo(init: fn(&mut [u8; 1024])) -> [u8; 1024] {
|
|
let mut buf = [0; 1024];
|
|
init(&mut buf);
|
|
buf
|
|
}
|
|
|
|
fn main() {
|
|
let _ = nrvo(|buf| { buf[4] = 4; });
|
|
}
|