2015-11-23 07:55:57 -06:00
|
|
|
#![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() {
|
2019-09-06 11:16:11 -05:00
|
|
|
call( //~ ERROR unreachable call
|
2015-11-23 07:55:57 -06:00
|
|
|
get_u8(),
|
|
|
|
diverge());
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|