2019-11-27 19:02:13 +00:00
|
|
|
//@ build-pass
|
|
|
|
//@ edition:2018
|
|
|
|
|
2023-09-18 15:18:51 +00:00
|
|
|
#![feature(if_let_guard)]
|
|
|
|
|
2019-11-27 19:02:13 +00:00
|
|
|
static A: [i32; 5] = [1, 2, 3, 4, 5];
|
|
|
|
|
|
|
|
async fn fun() {
|
|
|
|
let u = A[async { 1 }.await];
|
|
|
|
match A {
|
|
|
|
i if async { true }.await => (),
|
2023-09-18 15:18:51 +00:00
|
|
|
i if let Some(1) = async { Some(1) }.await => (),
|
2019-11-27 19:02:13 +00:00
|
|
|
_ => (),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
async {
|
|
|
|
let u = A[async { 1 }.await];
|
|
|
|
};
|
|
|
|
async {
|
|
|
|
match A {
|
|
|
|
i if async { true }.await => (),
|
2023-09-18 15:18:51 +00:00
|
|
|
i if let Some(2) = async { Some(2) }.await => (),
|
2019-11-27 19:02:13 +00:00
|
|
|
_ => (),
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|