rust/tests/ui/for-loop-while/liveness-move-in-loop.rs
2024-02-16 20:02:50 +00:00

21 lines
301 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() {}