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

12 lines
206 B
Rust
Raw Normal View History

fn foo<T>(o: myoption<T>) -> int {
let mut x: int;
2012-08-06 14:34:08 -05:00
match o { none::<T> => { fail; } some::<T>(t) => { x = 5; } }
2012-08-01 19:30:05 -05:00
return x;
}
enum myoption<T> { none, some(T), }
fn main() { log(debug, 5); }