summaryrefslogtreecommitdiffstats
path: root/tests/incremental/const-generics/hash-tyvid-regression-2.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/incremental/const-generics/hash-tyvid-regression-2.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
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 000000000..5cdd43cd7
--- /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() {}