mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
14 lines
237 B
Rust
14 lines
237 B
Rust
//@ run-pass
|
|
|
|
fn my_err(s: String) -> ! { println!("{}", s); panic!(); }
|
|
|
|
fn okay(i: usize) -> isize {
|
|
if i == 3 {
|
|
my_err("I don't like three".to_string());
|
|
} else {
|
|
return 42;
|
|
}
|
|
}
|
|
|
|
pub fn main() { okay(4); }
|