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

Replace parent substs of associated types with inference vars in borrow checker #85755

Merged
merged 2 commits into from Jun 17, 2021

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented May 27, 2021

Fixes #83190
Fixes #78450

When we normalize an associated type that refers to an opaque type, it can happen that the substs of the associated type do not occur in the projection (they are parent substs). We previously didn't replace those substs with inference vars, which left a concrete region after all regions should have already been replaced with inference vars and triggered a delay_span_bug. After we normalize the opaque type, we now try to replace any remaining concrete regions with inference vars.

@rust-highfive
Copy link
Collaborator

r? @jackh726

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 27, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 14, 2021
@nikomatsakis
Copy link
Contributor

r? @nikomatsakis

Normalization can pull in named regions from the parameter
environment. We need to be prepared for that in the opaque
types code.
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 17, 2021

📌 Commit 09eed28 has been approved by nikomatsakis

@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 Jun 17, 2021
@bors
Copy link
Contributor

bors commented Jun 17, 2021

⌛ Testing commit 09eed28 with merge 0ef2b4a...

@bors
Copy link
Contributor

bors commented Jun 17, 2021

☀️ Test successful - checks-actions
Approved by: nikomatsakis
Pushing 0ef2b4a to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 17, 2021
@bors bors merged commit 0ef2b4a into rust-lang:master Jun 17, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 17, 2021
@b-naber b-naber deleted the unexpected_concrete_region branch June 17, 2021 15:24
@oli-obk oli-obk added beta-accepted Accepted for backporting to the compiler in the beta channel. beta-nominated Nominated for backporting to the compiler in the beta channel. labels Aug 30, 2021
@oli-obk
Copy link
Contributor

oli-obk commented Aug 30, 2021

nominating and insta-accepting for beta backport since #83190 is still happening on beta

@spastorino
Copy link
Member

This patch is already included in beta

@oli-obk oli-obk removed beta-nominated Nominated for backporting to the compiler in the beta channel. beta-accepted Accepted for backporting to the compiler in the beta channel. labels Aug 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
9 participants