rust/src/test/run-pass/use-uninit-alt2.rs
2012-08-06 15:36:30 -07:00

12 lines
206 B
Rust

fn foo<T>(o: myoption<T>) -> int {
let mut x: int;
match o { none::<T> => { fail; } some::<T>(t) => { x = 5; } }
return x;
}
enum myoption<T> { none, some(T), }
fn main() { log(debug, 5); }