rust/tests/ui/for-loop-while/liveness-move-in-loop.rs
2023-01-11 09:32:08 +00:00

21 lines
299 B
Rust

// run-pass
#![allow(dead_code)]
// pretty-expanded FIXME #23616
fn take(x: isize) -> isize {x}
fn the_loop() {
let mut list = Vec::new();
loop {
let x = 5;
if x > 3 {
list.push(take(x));
} else {
break;
}
}
}
pub fn main() {}