Skip to content

Don't ICE when encountering bound regions in generator interior type #122358

New issue

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

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

Already on GitHub? # to your account

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

compiler-errors
Copy link
Member

I'm pretty sure this meant to say "has_free_regions", probably just a typo in 4a4fc3b. We can have bound regions (because we only convert non-bound regions into existential regions in generator interiors), but we can't have (non-ReErased) free regions.

r? lcnr

@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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Mar 12, 2024
@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2024

Some changes occurred to the core trait solver

cc @rust-lang/initiative-trait-system-refactor

@lcnr
Copy link
Contributor

lcnr commented Mar 12, 2024

maybe change it to !ty.has_free_regions() && !ty.has_escaping_bound_vars()

We can have bound regions (because we only convert non-bound regions into existential regions in generator interiors), but we can't have (non-ReErased) free regions.

given the fact that nested bound regions clearly must exist, it did take me a few minutes to actually understand what this meant here. Though, given that we ICE when tcx.fold_regions encounters a non-erased region, do we even need the debug_assert in the first place?

@compiler-errors
Copy link
Member Author

Yeah that debug assertion does nothing then.

@compiler-errors compiler-errors force-pushed the bound-regions-in-generator branch from 0df55aa to a79b56a Compare March 14, 2024 15:49
@rustbot
Copy link
Collaborator

rustbot commented Mar 14, 2024

Some changes occurred in src/tools/cargo

cc @ehuss

@compiler-errors compiler-errors force-pushed the bound-regions-in-generator branch from a79b56a to a85dbfb Compare March 14, 2024 15:50
@lcnr
Copy link
Contributor

lcnr commented Mar 14, 2024

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Mar 14, 2024

📌 Commit a85dbfb has been approved by lcnr

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 Mar 14, 2024
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member Author

lol I pushed at the same time as the r+

@bors -

@compiler-errors
Copy link
Member Author

@bors r-

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 14, 2024
@compiler-errors compiler-errors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 14, 2024
Copy link
Contributor

@lcnr lcnr left a comment

Choose a reason for hiding this comment

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

please add a "FIXME: use bound_coroutine_hidden_types instead and work towards removing this to coroutine_hidden_types". r=me after

@compiler-errors compiler-errors force-pushed the bound-regions-in-generator branch from a04ad8c to 04b45db Compare March 19, 2024 15:36
I refuse to fix this in the old solver; its lazy instantiation of
binders will be the end of me.
@compiler-errors compiler-errors force-pushed the bound-regions-in-generator branch from 04b45db to bca708b Compare March 19, 2024 15:52
@lcnr
Copy link
Contributor

lcnr commented Mar 21, 2024

❤️

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Mar 21, 2024

📌 Commit bca708b has been approved by lcnr

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 Mar 21, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Mar 21, 2024
…enerator, r=lcnr

Don't ICE when encountering bound regions in generator interior type

I'm pretty sure this meant to say "`has_free_regions`", probably just a typo in 4a4fc3b. We can have bound regions (because we only convert non-bound regions into existential regions in generator interiors), but we can't have (non-ReErased) free regions.

r? lcnr
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2024
…iaskrgr

Rollup of 8 pull requests

Successful merges:

 - rust-lang#122222 (deref patterns: bare-bones feature gate and typechecking)
 - rust-lang#122358 (Don't ICE when encountering bound regions in generator interior type)
 - rust-lang#122696 (Add bare metal riscv32 target.)
 - rust-lang#122773 (make "expected paren or brace" error translatable)
 - rust-lang#122795 (Inherit `RUSTC_BOOTSTRAP` when testing wasm)
 - rust-lang#122799 (Replace closures with `_` when suggesting fully qualified path for method call)
 - rust-lang#122801 (Fix misc printing issues in emit=stable_mir)
 - rust-lang#122806 (Make `type_ascribe!` not a built-in)

Failed merges:

 - rust-lang#122771 (add some comments to hir::ModuleItems)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e78522f into rust-lang:master Mar 21, 2024
@rustbot rustbot added this to the 1.79.0 milestone Mar 21, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 21, 2024
Rollup merge of rust-lang#122358 - compiler-errors:bound-regions-in-generator, r=lcnr

Don't ICE when encountering bound regions in generator interior type

I'm pretty sure this meant to say "`has_free_regions`", probably just a typo in 4a4fc3b. We can have bound regions (because we only convert non-bound regions into existential regions in generator interiors), but we can't have (non-ReErased) free regions.

r? lcnr
# for free to join this conversation on GitHub. Already have an account? # 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants