// check-fail // // regression test for issue 52893 trait At { type AtRes; fn at(self) -> Self::AtRes; } trait Push { type PushRes; fn push(self, other: T) -> Self::PushRes; } trait AddClass { type AddRes; fn init(self, func: F); } trait ToRef { type RefRes; fn to_ref(&self) -> Self::RefRes; } struct Class

(P); impl

Class

{ fn with(self) -> >::AddRes where Self: AddClass, { todo!() } fn from(self) -> >::AddRes where Self: AddClass, { todo!() } } impl AddClass for Class

where Self: At, >::AtRes: Push, <>::AtRes as Push>::PushRes: ToRef + Push, { type AddRes = (); fn init(self, func: F) { let builder = self.at().push(func); let output = builder.to_ref(); builder.push(output); //~ ERROR mismatched types [E0308] } } fn main() {}