Skip to content

life without region uniquification #127

Open
0 of 1 issue completed
Open
0 of 1 issue completed
@lcnr

Description

@lcnr

Region uniquification during canonicalization prevents us from caching parts of the query input, meaning that we have to walk the entire type. This results in hangs, e.g. for closures if a type is both an upvar and in the signature. It's known to affect itertools so we likely can't avoid it. Trying to reinstate the type length limit in rust-lang/rust#125507 ended up causing breakage for multiple projects, so we've reverted it in rust-lang/rust#127670.

To handle the crates affected by the type length limit, the new solver has to be able to cache components during canonicalization, forcing us to disable region uniquification. As MIR borrowck will continue to uniquify regions itself, we'll now have to manually maintain the invariant that if some goal G holds, then uniquified(G) also holds. At least for all G without non-region inference variables.

  • must not prefer trivially true candidates - at least if they reference regions - over other candidates. A candidate may only be trivially true due to region identity and result in non-trivial region constraints post uniqufication.
  • must not merge equal candidates, as they may have different constraints after uniqufication. Need to support OR-region constraints
  • have to solve equality of aliases with ambiguous normalization #75

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    potentially irrelevant

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions