about summary refs log tree commit diff
path: root/tests/ui/async-await/unreachable-lint-2.rs
blob: 137cb32481b9c4ab80e168224a73dbd961953191 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ edition:2018

#![deny(unreachable_code)]

async fn foo() {
    endless().await;
    println!("this is unreachable!");
    //~^ ERROR unreachable statement
}

async fn endless() -> ! {
    loop {}
}

fn main() { }