Opportunistically resolve region var in canonicalizer (instead of resolving root var)#118964
Merged
Conversation
Contributor
|
r? aliemjay |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 15, 2023
Rollup of 2 pull requests Successful merges: - rust-lang#118927 (Erase late bound regions from `Instance::fn_sig()` and add a few more details to StableMIR APIs) - rust-lang#118964 (Opportunistically resolve region var in canonicalizer (instead of resolving root var)) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Dec 15, 2023
Rollup merge of rust-lang#118964 - compiler-errors:resolve, r=aliemjay Opportunistically resolve region var in canonicalizer (instead of resolving root var) See comment in `compiler/rustc_type_ir/src/infcx.rs`. The **root** infer region for a given region vid may not actually be nameable from the universe of the original vid. That means that the assertion in the canonicalizer was too strict, since the `EagerResolver` that we use before canonicalizing is doing only as much resolving as it can. This replaces `resolve_lt_var` and `probe_lt_var` in the `rustc_type_ir` API with `opportunistic_resolve_lt_var`, which acts as you expect it should. I left a FIXME that complains about the inconsistency. This test is really gnarly, but I have no idea how to minimize it, since it seems to kind of just be coincidental that it triggered this issue. I hope the underlying root cause is easy enough to understand, though. r? `@lcnr` or `@aliemjay` Fixes rust-lang#118950
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See comment in
compiler/rustc_type_ir/src/infcx.rs.The root infer region for a given region vid may not actually be nameable from the universe of the original vid. That means that the assertion in the canonicalizer was too strict, since the
EagerResolverthat we use before canonicalizing is doing only as much resolving as it can.This replaces
resolve_lt_varandprobe_lt_varin therustc_type_irAPI withopportunistic_resolve_lt_var, which acts as you expect it should. I left a FIXME that complains about the inconsistency.This test is really gnarly, but I have no idea how to minimize it, since it seems to kind of just be coincidental that it triggered this issue. I hope the underlying root cause is easy enough to understand, though.
r? @lcnr or @aliemjay
Fixes #118950