For associated types we include both bounds written on the type
(type X: Trait
) and predicates from the trait: where Self::X: Trait
.
This exists as an optimization to compute only the supertraits of this implβs
trait that are outlives bounds.
This exists as an optimization to compute only the item bounds of the item
that are not Self
bounds.
Opaque types donβt inherit bounds from their parent: for return position
impl trait it isnβt possible to write a suitable predicate on the
containing function and for type-alias impl trait we donβt have a backwards
compatibility issue.
The code below is quite involved, so let me explain.