PageRenderTime 9ms CodeModel.GetById 2ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/ret-bang.rs

http://github.com/jruderman/rust
Rust | 11 lines | 5 code | 5 blank | 1 comment | 3 complexity | 920a288756dbc5690eb7fb4e85b53aa7 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5fn my_err(s: ~str) -> ! { log(error, s); fail; }
 6
 7fn okay(i: uint) -> int {
 8    if i == 3u { my_err(~"I don't like three"); } else { return 42; }
 9}
10
11fn main() { okay(4u); }