rust/tests/ui/reachable/unreachable-in-call.rs
2023-01-11 09:32:08 +00:00

23 lines
345 B
Rust

#![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() {}