about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHameer Abbasi <einstein.edison@gmail.com>2020-09-29 13:18:29 +0200
committerHameer Abbasi <einstein.edison@gmail.com>2020-09-29 13:19:51 +0200
commit2c385040550fb1eb98cf14ace99129f05b1d7b3f (patch)
tree8bae6191eacc0d7470781cdbdc8fbf8f95f040e1
parent26373fb4baa9c5b8a7a1e2821fcfa930a85d327d (diff)
downloadrust-2c385040550fb1eb98cf14ace99129f05b1d7b3f.tar.gz
rust-2c385040550fb1eb98cf14ace99129f05b1d7b3f.zip
Add test for async/await combined with const-generics.
-rw-r--r--src/test/ui/const-generics/issue-74906.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/issue-74906.rs b/src/test/ui/const-generics/issue-74906.rs
new file mode 100644
index 00000000000..9162d1142b6
--- /dev/null
+++ b/src/test/ui/const-generics/issue-74906.rs
@@ -0,0 +1,25 @@
+// edition:2018
+// check-pass
+// revisions: full min
+#![cfg_attr(full, feature(const_generics))]
+#![cfg_attr(full, allow(incomplete_features))]
+#![cfg_attr(min, feature(min_const_generics))]
+
+const SIZE: usize = 16;
+
+struct Bar<const H: usize> {}
+
+struct Foo<const H: usize> {}
+
+impl<const H: usize> Foo<H> {
+    async fn biz(_: &[[u8; SIZE]]) -> Vec<()> {
+        vec![]
+    }
+
+    pub async fn baz(&self) -> Bar<H> {
+        Self::biz(&vec![]).await;
+        Bar {}
+    }
+}
+
+fn main() { }