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

Don't expect early-bound region to be local when reporting errors in RPITIT well-formedness #120707

Merged
merged 1 commit into from
Feb 7, 2024

Conversation

compiler-errors
Copy link
Member

The implicit lifetime in the example code gets replaced with ReError, which fails a sub_regions check in the lexical region solver. Error reporting ends up calling is_suitable_region on an early bound region in the trait definition. This causes an ICE because we expect_local().

This is kind of a bad explanation, but this code just makes diagnostics reporting a bit more gracefully fallible. If the reviewer wants a thorough investigation of exactly where we get this region outlives obligation, I can write one up. Doesn't really seem worth it, though, imo.

Fixes #120638
Fixes #120648

@rustbot
Copy link
Collaborator

rustbot commented Feb 6, 2024

r? @nnethercote

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 6, 2024
@nnethercote
Copy link
Contributor

Trivial change, fixing two issues, with tests? Fine by me, even though I don't particularly understand this code.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 6, 2024

📌 Commit d9cd0d4 has been approved by nnethercote

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 6, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#119939 (Improve 'generic param from outer item' error for `Self` and inside `static`/`const` items)
 - rust-lang#120331 (pattern_analysis: use a plain `Vec` in `DeconstructedPat`)
 - rust-lang#120396 (Account for unbounded type param receiver in suggestions)
 - rust-lang#120423 (update indirect structural match lints to match RFC and to show up for dependencies)
 - rust-lang#120435 (Suggest name value cfg when only value is used for check-cfg)
 - rust-lang#120502 (Remove `ffi_returns_twice` feature)
 - rust-lang#120507 (Account for non-overlapping unmet trait bounds in suggestion)
 - rust-lang#120513 (Normalize type outlives obligations in NLL for new solver)
 - rust-lang#120707 (Don't expect early-bound region to be local when reporting errors in RPITIT well-formedness)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 84114fe into rust-lang:master Feb 7, 2024
11 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 7, 2024
Rollup merge of rust-lang#120707 - compiler-errors:suitable-region, r=nnethercote

Don't expect early-bound region to be local when reporting errors in RPITIT well-formedness

The implicit lifetime in the example code gets replaced with `ReError`, which fails a `sub_regions` check in the lexical region solver. Error reporting ends up calling `is_suitable_region` on an early bound region in the *trait* definition. This causes an ICE because we `expect_local()`.

This is kind of a bad explanation, but this code just makes diagnostics reporting a bit more gracefully fallible. If the reviewer wants a thorough investigation of exactly where we get this region outlives obligation, I can write one up. Doesn't really seem worth it, though, imo.

Fixes rust-lang#120638
Fixes rust-lang#120648
@rustbot rustbot added this to the 1.78.0 milestone Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
4 participants