rust/src/test/run-pass/use-uninit-alt2.rs

12 lines
202 B
Rust
Raw Normal View History

fn foo<T>(o: myoption<T>) -> int {
2011-07-27 07:19:39 -05:00
let x: int;
alt o { none::<T>. { fail; } some::<T>(t) { x = 5; } }
ret x;
}
tag myoption<T> { none; some(T); }
fn main() { log_full(core::debug, 5); }