// Checking the `Send` bound in `main` requires: // // checking as Y>::P: Send // which normalizes to Box>>: Send // which needs X>: Send // which needs as Y>::P: Send // // At this point we used to normalize the predicate to `Box>>: Send` // and continue in a loop where we created new region variables to the // recursion limit. To avoid this we now "canonicalize" region variables to // lowest unified region vid. This means we instead have to prove // `Box>>: Send`, which we can because auto traits are coinductive. //@ check-pass // Avoid a really long error message if this regresses. #![recursion_limit="20"] trait Y { type P; } impl<'a> Y for C<'a> { type P = Box>>; } struct C<'a>(&'a ()); struct X(T::P); fn is_send() {} fn main() { is_send::>>(); }