summaryrefslogtreecommitdiffstats
path: root/src/test/ui/const-generics/try_unify_ignore_lifetimes.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/const-generics/try_unify_ignore_lifetimes.rs')
-rw-r--r--src/test/ui/const-generics/try_unify_ignore_lifetimes.rs33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/ui/const-generics/try_unify_ignore_lifetimes.rs b/src/test/ui/const-generics/try_unify_ignore_lifetimes.rs
new file mode 100644
index 000000000..2ae0ae70d
--- /dev/null
+++ b/src/test/ui/const-generics/try_unify_ignore_lifetimes.rs
@@ -0,0 +1,33 @@
+// check-pass
+#![feature(generic_const_exprs)]
+#![allow(incomplete_features)]
+
+struct Num<const N: usize>;
+
+trait NumT {
+ const VALUE: usize;
+}
+
+impl<const N: usize> NumT for Num<N> {
+ const VALUE: usize = N;
+}
+
+struct Foo<'a, N: NumT>(&'a [u32; N::VALUE]) where [(); N::VALUE]:;
+
+trait Bar {
+ type Size: NumT;
+
+ fn bar<'a>(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
+ todo!();
+ }
+}
+
+trait Baz<'a> {
+ type Size: NumT;
+
+ fn baz(foo: &Foo<'a, Self::Size>) where [(); Self::Size::VALUE]: {
+ todo!();
+ }
+}
+
+fn main() {}