rust/tests/incremental/const-generics/hash-tyvid-regression-2.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
474 B
Rust
Raw Normal View History

2021-08-18 15:15:33 -05:00
// revisions: cfail
2021-10-23 10:57:49 -05:00
#![feature(generic_const_exprs, adt_const_params)]
2021-08-18 15:15:33 -05:00
#![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() {}