about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2019-11-27 19:02:13 +0000
committerMatthew Jasper <mjjasper1@gmail.com>2019-11-27 19:21:56 +0000
commitdf625bdc26b0bccd6390fe22f0fc112e511667f4 (patch)
treecf52bb58f7d688d8ccd2ca13cf69e61339c6a1a5 /src
parent1f850f61ead8b6fc05236e5e2514c2b6c9fe34de (diff)
downloadrust-df625bdc26b0bccd6390fe22f0fc112e511667f4.tar.gz
rust-df625bdc26b0bccd6390fe22f0fc112e511667f4.zip
Add async fn test for #66695
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/async-await/issues/issue-66695-static-refs.rs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/test/ui/async-await/issues/issue-66695-static-refs.rs b/src/test/ui/async-await/issues/issue-66695-static-refs.rs
new file mode 100644
index 00000000000..f0609713b4d
--- /dev/null
+++ b/src/test/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 => (),
+            _ => (),
+        }
+    };
+}