//@ build-fail // Regression test for issue #137823 // Tests that recursive monomorphization with associated types produces // a proper "recursion limit" error instead of an ICE. fn convert() -> S::Out { convert2::>() //~^ ERROR: reached the recursion limit while instantiating } fn convert2() -> S::Out { convert::() } fn main() { convert::(); } trait Converter { type Out; } struct Ser; impl Converter for Ser { type Out = (); } struct ConvertWrap { _d: S, } impl Converter for ConvertWrap where S: Converter, { type Out = S::Out; }