Why can't I refine RPIT if method takes GAT?

This is a flavor of this issue. I created a diagnostic issue too.

The early/late is intentional, because generic associated types don't constrain their lifetime parameters (since you don't have to use the parameter in the definition).[1]

As that's a soundness consideration, probably the only "fix" to the "bugs" is if trait implementations automatically inherit early-boundedness from the trait definition, instead of being implied by the signature... which is also kinda bleh.

Or some much wider change to early-vs-late bounds more generally, but that seems distant-future to me.


  1. breadcrumb ↩︎

3 Likes