1 // regression test for #74868
9 impl<'a, T> BoxedDsl<'a> for T
13 type Output = <T as BoxedDsl<'a>>::Output;
16 // Showing this trait is wf requires proving
19 // The impl below is a candidate for this projection, as well as the `Self:
20 // HandleUpdate` bound in the environment.
21 // We evaluate both candidates to see if we need to consider both applicable.
22 // Evaluating the impl candidate requires evaluating
23 // <T as BoxedDsl<'static>>::Output == ()
24 // The above impl cause normalizing the above type normalize to itself.
26 // This previously compiled because we would generate a new region
27 // variable each time around the cycle, and evaluation would eventually return
28 // `EvaluatedToErr` from the `Self: Sized` in the impl, which would in turn
29 // leave the bound as the only candidate.
31 // #73452 changed this so that region variables are canonicalized when we
32 // normalize, which means that the projection cycle is detected before
33 // evaluation returns EvaluatedToErr. The cycle resulted in an error being
34 // emitted immediately, causing this to fail to compile.
36 // To fix this, normalization doesn't directly emit errors when it finds a
37 // cycle, instead letting the caller handle it. This restores the original
41 impl<T> HandleUpdate for T where T: BoxedDsl<'static, Output = ()> {}