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

12 lines
194 B
Rust

fn foo<T>(o: myoption<T>) -> int {
let mut 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); }