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

12 lines
190 B
Rust
Raw Normal View History

fn foo<T>(o: myoption<T>) -> int {
2011-07-27 07:19:39 -05:00
let x: int = 5;
alt o { none::<T> { } some::<T>(t) { x += 1; } }
ret x;
}
enum myoption<T> { none; some(T); }
fn main() { log(debug, 5); }