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 ICE when opaque types get their hidden type constrained again. #95471

Merged
merged 1 commit into from
Mar 31, 2022

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Mar 30, 2022

Contrary to popular belief, codegen_fulfill_obligation does not get used solely in codegen, so we cannot rely on param_env being set to RevealAll and thus revealing the hidden types instead of constraining them.

Fixes #89312 (for real this time)

Contrary to popular belief, `codegen_fulfill_obligation` does not get used solely in codegen, so we cannot rely on `param_env` being set to RevealAll and thus revealing the hidden types instead of constraining them.
@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 30, 2022
@rust-highfive
Copy link
Collaborator

r? @estebank

(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 Mar 30, 2022
Comment on lines +90 to +92
// Opaque types may have gotten their hidden types constrained, but we can ignore them safely
// as they will get constrained elsewhere, too.
let _opaque_types = infcx.inner.borrow_mut().opaque_type_storage.take_opaque_types();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"We can ignore them safely"

Do we have anything we could do to prevent a refactor from making that not true anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I can reveal them manually and check that the ones found here are equivalent

@estebank
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Mar 30, 2022

📌 Commit 1144677 has been approved by estebank

@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 Mar 30, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Mar 30, 2022
Don't ICE when opaque types get their hidden type constrained again.

Contrary to popular belief, `codegen_fulfill_obligation` does not get used solely in codegen, so we cannot rely on `param_env` being set to RevealAll and thus revealing the hidden types instead of constraining them.

Fixes rust-lang#89312 (for real this time)
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 31, 2022
Rollup of 5 pull requests

Successful merges:

 - rust-lang#95130 (Stabilize thread::is_finished)
 - rust-lang#95263 (Restore `impl Future<Output = Type>` to async blocks)
 - rust-lang#95471 (Don't ICE when opaque types get their hidden type constrained again.)
 - rust-lang#95491 (Stabilize feature vec_retain_mut on Vec and VecDeque)
 - rust-lang#95497 (Spellchecking compiler comments)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 64a3767 into rust-lang:master Mar 31, 2022
@rustbot rustbot added this to the 1.61.0 milestone Mar 31, 2022
Alexendoo added a commit to Alexendoo/glacier that referenced this pull request Mar 31, 2022
Alexendoo added a commit to rust-lang/glacier that referenced this pull request Mar 31, 2022
…lang/rust#92007)""

This reverts commit c34cdca.

89312 is fixed by rust-lang/rust#95471

The rest by lazy TAIT take two rust-lang/rust#94081

Closes #1189
Closes #1190
Closes #1191
Closes #1192
Closes #1193
Closes #1194
Closes #1195
Closes #1196
Closes #1197
Closes #1198
Closes #1199
Closes #1200
Closes #1201
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
Development

Successfully merging this pull request may close these issues.

ice: Encountered error .. selecting .. during codegen: glacier / fixed/72793.rs
5 participants