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

12 lines
203 B
Rust
Raw Normal View History

fn foo<T>(o: myoption<T>) -> int {
let mut x: int = 5;
2012-08-03 21:59:04 -05:00
alt o { none::<T> => { } some::<T>(t) => { x += 1; } }
2012-08-01 19:30:05 -05:00
return x;
}
enum myoption<T> { none, some(T), }
fn main() { log(debug, 5); }