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

12 lines
195 B
Rust

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