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

11 lines
182 B
Rust
Raw Normal View History

2011-05-20 21:53:50 -05:00
// -*- rust -*-
2011-07-27 07:19:39 -05:00
fn my_err(s: str) -> ! { log_err s; fail; }
2011-05-20 21:53:50 -05:00
2011-07-27 07:19:39 -05:00
fn okay(i: uint) -> int {
if i == 3u { my_err("I don't like three"); } else { ret 42; }
2011-05-20 21:53:50 -05:00
}
fn main() { okay(4u); }