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

12 lines
191 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;
}
enum myoption<T> { none; some(T); }
fn main() { log(debug, 5); }