Don't require rigid alias's trait to hold by compiler-errors · Pull Request #139828 · rust-lang/rust (original) (raw)

See test for write-up. TL;DR is that we don't need the trait bound to hold, since we enforce it during WF.

I think this is preferable to introducing (if we even could do so) a more specific hack around coroutine interiors, higher ranked types, etc, since this is just a manifestation of more pervasive issues w/ lifetime erasure in coroutines. This just doesn't manifest in the old solver b/c it doesn't try to prove T: Trait holds when rigidly projecting <T as Trait>::Assoc.

It's pretty clear that this affects quite a few traits (#139763), so I think this needs fixing.

r? lcnr

Fixes rust-lang/trait-system-refactor-initiative#177