rust/src/test/ui/borrowck/borrowck-break-uninit.rs
2018-12-25 21:08:33 -07:00

15 lines
220 B
Rust

fn foo() -> isize {
let x: isize;
loop {
break;
x = 0;
}
println!("{}", x); //~ ERROR use of possibly uninitialized variable: `x`
return 17;
}
fn main() { println!("{}", foo()); }