about summary refs log tree commit diff
path: root/tests/ui/async-await/no-non-guaranteed-initialization.rs
blob: f5ab5309e2d6a15f92cf01986cec472f92643cba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
//@ edition:2018
//@ compile-flags: --crate-type lib

async fn no_non_guaranteed_initialization(x: usize) -> usize {
    let y;
    if x > 5 {
        y = echo(10).await;
    }
    y //~ ERROR E0381
}

async fn echo(x: usize) -> usize { x + 1 }