about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-01-10 11:03:07 +0100
committerGitHub <noreply@github.com>2022-01-10 11:03:07 +0100
commitca9fc28f0be061ef770bec410d90c5418b6689dd (patch)
tree5ae7da92a0fa647143e1c7283e19840591d90ffa /src/test
parenta4ac4fae416b18f71a2f7ef2772ca4a4cc871828 (diff)
parentd35b23ecd8f8fd1aa33ebd106bb5f13414a66cf4 (diff)
Rollup merge of #92636 - compiler-errors:normalize-generator-const-expr, r=oli-obk
Normalize generator-local types with unevaluated constants

Normalize generator-interior types in addition to (i.e. instead of just) erasing regions, since sometimes we collect types with unevaluated const exprs.

Fixes #84737
Fixes #88171
Fixes #92091
Fixes #92634
Probably also fixes #73114, but that one has no code I could test. It looks like it's the same issue, though.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/async-await/interior-with-const-generic-expr.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/ui/async-await/interior-with-const-generic-expr.rs b/src/test/ui/async-await/interior-with-const-generic-expr.rs
new file mode 100644
index 00000000000..86ba7582d38
--- /dev/null
+++ b/src/test/ui/async-await/interior-with-const-generic-expr.rs
@@ -0,0 +1,26 @@
+// edition:2018
+// run-pass
+
+#![allow(incomplete_features)]
+#![feature(generic_const_exprs)]
+#![allow(unused)]
+
+fn main() {
+    let x = test();
+}
+
+fn concat<const A: usize, const B: usize>(a: [f32; A], b: [f32; B]) -> [f32; A + B] {
+    todo!()
+}
+
+async fn reverse<const A: usize>(x: [f32; A]) -> [f32; A] {
+    todo!()
+}
+
+async fn test() {
+    let a = [0.0];
+    let b = [1.0, 2.0];
+    let ab = concat(a,b);
+    let ba = reverse(ab).await;
+    println!("{:?}", ba);
+}