rust/src/test/run-pass/borrowck-pat-reassign-no-binding.rs
2012-05-16 12:44:54 -07:00

15 lines
303 B
Rust

// xfail-fast (compile-flags unsupported on windows)
// compile-flags:--borrowck=err
fn main() {
let mut x = none;
alt x {
none {
// It is ok to reassign x here, because there is in
// fact no outstanding loan of x!
x = some(0);
}
some(_) { }
}
}