Stream: wg-traits

Topic: regions and generators #64552

nikomatsakis (Oct 08 2019 at 17:26, on Zulip):

Hey @Aaron Hill -- let's discuss a bit! (Putting this msg here so I don't forget)

Maybe we can sched a time to sync up?

Aaron Hill (Oct 25 2019 at 22:10, on Zulip):

@nikomatsakis Sorry, I really should check Zulip more frequently - I just saw your message

Aaron Hill (Oct 25 2019 at 22:24, on Zulip):

I've taken a look at this recently. The main issue I ran into was how to extract the relevant information from the InferCtxt. We obviously don't want to have a GeneratorWitness carry around the entire InferCtxt from its parent function. I think we need to:

  1. Determine which region constraints are 'relevant' (from RegionConstraintCollector).
  2. Extract them from the InferCtxt, and re-write them to use the late-bound variables used by the witness type.
  3. When SelectionContext processes a GeneratorWitness predicate, create fresh inference variables in the SelectionContext's InferCtxt, and apply the stored constraints the new inference variables.

However, I've not that familiar with how region inference works, so I might be missing something.

Last update: Jun 07 2020 at 09:40UTC