Add a regression test for a former blanket impl synthesis ICE

This commit is contained in:
León Orell Valerian Liehr 2024-06-03 03:50:15 +02:00
parent 77d4115655
commit b320ac7491
No known key found for this signature in database
GPG Key ID: D17A07215F68E713

View File

@ -0,0 +1,19 @@
//@ check-pass
// https://github.com/rust-lang/rust/issues/119792
struct Wrapper<T>(T);
trait Div<Rhs> {}
trait Mul<Rhs> {
type Output;
}
impl<T> Mul<T> for Wrapper<T> {
type Output = ();
}
impl<T> Div<Self> for Wrapper<T> {}
pub trait NumOps<Rhs> {}
impl<T, Rhs> NumOps<Rhs> for T where T: Mul<Rhs, Output = ()> + Div<Rhs> {}