Skip to content

Refactor propagation to be more explicit #32730

Closed
@nikomatsakis

Description

@nikomatsakis

In conjunction with @soltanmm, and with an aim towards enabling lazy normalization, HR-caching, specialization's lifetime dispatch rules, and a number of other things, we should refactor the way we propagate obligations and mutable state through the inference context.

The general idea is to make the result of unification also carry a list of obligations. This can be used by lazy normalizing to carry the results of normalization, but we should also (eventually) move all mutation of the region inference state out and use it to carry region edges that result. This will help simplify the skolemization code, with the lifetime dispatch logic, and with more advanced caching. It might also make sense to eventually move the unification of type variables too, so that unify is a pure function.

At the moment, this issue exists mainly to serve as a placeholder for FIXME, but I hope to expand with a bit more design and also some checklist of to-do items. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions