summaryrefslogtreecommitdiffstats
path: root/tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs')
-rw-r--r--tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs b/tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs
new file mode 100644
index 000000000..204cf9def
--- /dev/null
+++ b/tests/ui/generic-const-items/unsatisfied-outlives-bounds.rs
@@ -0,0 +1,17 @@
+#![feature(generic_const_items)]
+#![allow(incomplete_features)]
+
+// Ensure that we check if outlives-bounds on const items hold or not.
+
+const C<'a, T: 'a>: () = ();
+const K<'a, 'b: 'a>: () = ();
+
+fn parametrized0<'any>() {
+ let () = C::<'static, &'any ()>; //~ ERROR lifetime may not live long enough
+}
+
+fn parametrized1<'any>() {
+ let () = K::<'static, 'any>; //~ ERROR lifetime may not live long enough
+}
+
+fn main() {}