]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/no-non-guaranteed-initialization.rs
Rollup merge of #63737 - HowJMay:fix_naming, r=jonas-schievink
[rust.git] / src / test / ui / async-await / no-non-guaranteed-initialization.rs
1 // compile-fail
2 // edition:2018
3 // compile-flags: --crate-type lib
4
5 async fn no_non_guaranteed_initialization(x: usize) -> usize {
6     let y;
7     if x > 5 {
8         y = echo(10).await;
9     }
10     y
11     //~^ use of possibly uninitialized variable: `y`
12 }
13
14 async fn echo(x: usize) -> usize { x + 1 }