rust/src/test/run-pass/alt-ref-binding.rs
Niko Matsakis a6a5c48c64 make ref x bindings produce region ptrs and fix various minor bugs
we now detect inconsistent modes, binding names, and various other errors.
typeck/trans integration is mostly done.

borrowck not so much.

more tests needed.
2012-08-06 16:12:40 -07:00

10 lines
155 B
Rust

fn destructure(x: option<int>) -> int {
alt x {
none => 0,
some(ref v) => *v
}
}
fn main() {
assert destructure(some(22)) == 22;
}