granite-rust/src/test/ui/async-await/no-non-guaranteed-initialization.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
280 B
Rust
Raw Normal View History

// 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
//~^ use of possibly-uninitialized variable: `y`
}
async fn echo(x: usize) -> usize { x + 1 }