2023-04-05 03:44:20 -05:00
|
|
|
// ignore-wasm32 compiled with panic=abort by default
|
2022-04-13 04:20:46 -05:00
|
|
|
// unit-test: RenameReturnPlace
|
2020-05-25 16:37:10 -05:00
|
|
|
|
2020-07-27 14:22:43 -05:00
|
|
|
// EMIT_MIR nrvo_simple.nrvo.RenameReturnPlace.diff
|
2020-05-15 16:57:42 -05:00
|
|
|
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; });
|
|
|
|
}
|