mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-02 15:32:06 +00:00
31 lines
387 B
Rust
31 lines
387 B
Rust
|
use std;
|
||
|
import std::option::*;
|
||
|
|
||
|
fn baz() -> ! {
|
||
|
fail;
|
||
|
}
|
||
|
|
||
|
fn foo() {
|
||
|
alt (some[int](5)) {
|
||
|
case (some[int](?x)) {
|
||
|
auto bar;
|
||
|
alt (none[int]) {
|
||
|
case (none[int]) {
|
||
|
bar = 5;
|
||
|
}
|
||
|
case (_) {
|
||
|
baz();
|
||
|
}
|
||
|
}
|
||
|
log bar;
|
||
|
}
|
||
|
case (none[int]) {
|
||
|
log "hello";
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
foo();
|
||
|
}
|