Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

life without region uniquification #127

Open
lcnr opened this issue Sep 5, 2024 · 0 comments
Open

life without region uniquification #127

lcnr opened this issue Sep 5, 2024 · 0 comments

Comments

@lcnr
Copy link
Contributor

lcnr commented Sep 5, 2024

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

@lcnr lcnr changed the title [META] region uniquification [META] region uniquification not possible Sep 5, 2024
@lcnr lcnr changed the title [META] region uniquification not possible life without region uniquification Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant