mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-01 03:03:40 +00:00
23 lines
345 B
Rust
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() {}
|