2023-10-16 17:36:39 +00:00
|
|
|
// skip-filecheck
|
2023-06-08 09:18:34 +02:00
|
|
|
// EMIT_MIR_FOR_EACH_PANIC_STRATEGY
|
2024-05-31 00:22:40 +00:00
|
|
|
//@ test-mir-pass: RenameReturnPlace
|
2020-05-25 23:37:10 +02:00
|
|
|
|
2024-05-31 00:22:40 +00:00
|
|
|
// EMIT_MIR nrvo_simple.nrvo.RenameReturnPlace.diff
|
2020-05-15 14:57:42 -07:00
|
|
|
fn nrvo(init: fn(&mut [u8; 1024])) -> [u8; 1024] {
|
|
|
|
let mut buf = [0; 1024];
|
|
|
|
init(&mut buf);
|
|
|
|
buf
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2024-06-03 10:18:33 +10:00
|
|
|
let _ = nrvo(|buf| {
|
|
|
|
buf[4] = 4;
|
|
|
|
});
|
2020-05-15 14:57:42 -07:00
|
|
|
}
|