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

11 lines
193 B
Rust

fn foo[T](&myoption[T] o) -> int {
let int x;
alt (o) { case (none[T]) { fail; } case (some[T](?t)) { x = 5; } }
ret x;
}
tag myoption[T] { none; some(T); }
fn main() { log 5; }