]> git.lizzy.rs Git - rust.git/blob - tests/ui/ret-bang.rs
Auto merge of #106253 - nbdd0121:upcast, r=compiler-errors
[rust.git] / tests / ui / ret-bang.rs
1 // run-pass
2
3 fn my_err(s: String) -> ! { println!("{}", s); panic!(); }
4
5 fn okay(i: usize) -> isize {
6     if i == 3 {
7         my_err("I don't like three".to_string());
8     } else {
9         return 42;
10     }
11 }
12
13 pub fn main() { okay(4); }