summaryrefslogtreecommitdiffstats
path: root/src/test/ui/ret-bang.rs
blob: 6618992e0361f0514c1f824dc57e4a8fdff540c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// 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); }