summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/late-bound-vars
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/const-generics/late-bound-vars')
-rw-r--r--tests/ui/const-generics/late-bound-vars/in_closure.rs18
-rw-r--r--tests/ui/const-generics/late-bound-vars/simple.rs16
2 files changed, 34 insertions, 0 deletions
diff --git a/tests/ui/const-generics/late-bound-vars/in_closure.rs b/tests/ui/const-generics/late-bound-vars/in_closure.rs
new file mode 100644
index 000000000..5294cc3b5
--- /dev/null
+++ b/tests/ui/const-generics/late-bound-vars/in_closure.rs
@@ -0,0 +1,18 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+const fn inner<'a>() -> usize where &'a (): Sized {
+ 3
+}
+
+fn test<'a>() {
+ let _ = || {
+ let _: [u8; inner::<'a>()];
+ let _ = [0; inner::<'a>()];
+ };
+}
+
+fn main() {
+ test();
+}
diff --git a/tests/ui/const-generics/late-bound-vars/simple.rs b/tests/ui/const-generics/late-bound-vars/simple.rs
new file mode 100644
index 000000000..6da5395ef
--- /dev/null
+++ b/tests/ui/const-generics/late-bound-vars/simple.rs
@@ -0,0 +1,16 @@
+// run-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+const fn inner<'a>() -> usize where &'a (): Sized {
+ 3
+}
+
+fn test<'a>() {
+ let _: [u8; inner::<'a>()];
+ let _ = [0; inner::<'a>()];
+}
+
+fn main() {
+ test();
+}