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 19:34:08 +00:00
match o { none::<T> => { fail; } some::<T>(t) => { x = 5; } }
2012-08-02 00:30:05 +00:00
return x;
}
enum myoption<T> { none, some(T), }
fn main() { log(debug, 5); }