rust/tests/ui/borrowck/borrowck-break-uninit-2.rs
2023-01-11 09:32:08 +00:00

15 lines
191 B
Rust

fn foo() -> isize {
let x: isize;
while 1 != 2 {
break;
x = 0;
}
println!("{}", x); //~ ERROR E0381
return 17;
}
fn main() { println!("{}", foo()); }