summaryrefslogtreecommitdiffstats
path: root/tests/ui/reachable/unreachable-in-call.rs
blob: dd94e79f4d84c717895f8821461dc716529374be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![allow(dead_code)]
#![deny(unreachable_code)]

fn diverge() -> ! { panic!() }

fn get_u8() -> u8 {
    1
}
fn call(_: u8, _: u8) {

}
fn diverge_first() {
    call(diverge(),
         get_u8()); //~ ERROR unreachable expression
}
fn diverge_second() {
    call( //~ ERROR unreachable call
        get_u8(),
        diverge());
}

fn main() {}