diff options
Diffstat (limited to 'tests/ui/async-await/issues/issue-66695-static-refs.rs')
-rw-r--r-- | tests/ui/async-await/issues/issue-66695-static-refs.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/async-await/issues/issue-66695-static-refs.rs b/tests/ui/async-await/issues/issue-66695-static-refs.rs new file mode 100644 index 000000000..f0609713b --- /dev/null +++ b/tests/ui/async-await/issues/issue-66695-static-refs.rs @@ -0,0 +1,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 => (), + _ => (), + } + }; +} |