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

12 lines
189 B
Rust
Raw Normal View History

2011-05-20 21:53:50 -05:00
// -*- rust -*-
fn my_err(s: ~str) -> ! { log(error, 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); }