rust/src/test/run-pass/borrowck-preserve-box-sometimes-needed.rs
2012-08-06 15:36:30 -07:00

14 lines
223 B
Rust

// exec-env:RUST_POISON_ON_FREE=1
fn switcher(x: option<@int>) {
let mut x = x;
match x {
some(@y) => { copy y; x = none; }
none => { }
}
}
fn main() {
switcher(none);
switcher(some(@3));
}