rust/tests/ui/for-loop-while/liveness-move-in-loop.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
299 B
Rust
Raw Normal View History

// 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() {}