]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/issues/issue-66695-static-refs.rs
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / issues / issue-66695-static-refs.rs
1 // build-pass
2 // edition:2018
3
4 static A: [i32; 5] = [1, 2, 3, 4, 5];
5
6 async fn fun() {
7     let u = A[async { 1 }.await];
8     match A {
9         i if async { true }.await => (),
10         _ => (),
11     }
12 }
13
14 fn main() {
15     async {
16         let u = A[async { 1 }.await];
17     };
18     async {
19         match A {
20             i if async { true }.await => (),
21             _ => (),
22         }
23     };
24 }