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 -*-
fn my_err(str s) -> ! { log_err s; fail; }
2011-05-20 21:53:50 -05:00
fn okay(uint i) -> 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); }