about summary refs log tree commit diff
path: root/tests/incremental/const-generics/hash-tyvid-regression-2.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/incremental/const-generics/hash-tyvid-regression-2.rs')
-rw-r--r--tests/incremental/const-generics/hash-tyvid-regression-2.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/incremental/const-generics/hash-tyvid-regression-2.rs b/tests/incremental/const-generics/hash-tyvid-regression-2.rs
new file mode 100644
index 00000000000..5cdd43cd782
--- /dev/null
+++ b/tests/incremental/const-generics/hash-tyvid-regression-2.rs
@@ -0,0 +1,18 @@
+// revisions: cfail
+#![feature(generic_const_exprs, adt_const_params)]
+#![allow(incomplete_features)]
+// regression test for #77650
+struct C<T, const N: core::num::NonZeroUsize>([T; N.get()])
+where
+    [T; N.get()]: Sized;
+impl<'a, const N: core::num::NonZeroUsize, A, B: PartialEq<A>> PartialEq<&'a [A]> for C<B, N>
+where
+    [B; N.get()]: Sized,
+{
+    fn eq(&self, other: &&'a [A]) -> bool {
+        self.0 == other
+        //~^ error: can't compare
+    }
+}
+
+fn main() {}