summaryrefslogtreecommitdiffstats
path: root/src/test/ui/async-await/issues/issue-66695-static-refs.rs
blob: f0609713b4ddcb652f97d1c7c05e4c4b815761d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// build-pass
// edition:2018

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 => (),
        _ => (),
    }
}

fn main() {
    async {
        let u = A[async { 1 }.await];
    };
    async {
        match A {
            i if async { true }.await => (),
            _ => (),
        }
    };
}