rustc/tests/ui/for-loop-while/liveness-move-in-loop.rs
2025-02-17 11:14:05 +01:00

20 lines
268 B
Rust

//@ run-pass
#![allow(dead_code)]
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() {}