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

chalk: Fix wrong debrujin index in opaque type handling. #94235

Merged
merged 3 commits into from
Feb 26, 2022

Conversation

Dirbaio
Copy link
Contributor

@Dirbaio Dirbaio commented Feb 21, 2022

A folder in opaque type lowering was substituting all opaque type references with a variable with debrujin index 0 ignoring how many binders deep we are.

This caused an ICE with Not enough bound vars: ^0 not found in [] (full logs) with the following code.

fn main() -> () {}
async fn foo(x: u32) -> u32 {
    x
}

With the fix, it no longer ICEs. It still doesn't typecheck due to generator issues. I've added a "known-bug" test so that at least it doesn't regress back to ICEing.

r? @jackh726

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Feb 21, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 21, 2022
@jackh726
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 26, 2022

📌 Commit a1d8ce4 has been approved by jackh726

@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 26, 2022
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Feb 26, 2022
…r=jackh726

chalk: Fix wrong debrujin index in opaque type handling.

A folder in opaque type lowering was substituting all opaque type references with a variable with debrujin index 0 ignoring how many binders deep we are.

This caused an ICE with `Not enough bound vars: ^0 not found in []` ([full logs](https://gist.github.com/Dirbaio/2b9374ff4fce37afb9d665dc9f0000df)) with the following code.

```rust
fn main() -> () {}
async fn foo(x: u32) -> u32 {
    x
}
```

With the fix, it no longer ICEs. It still doesn't typecheck due to generator issues. I've added a "known-bug" test so that at least it doesn't regress back to ICEing.

r? `@jackh726`
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 26, 2022
…askrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#93400 (Do not suggest using a const parameter when there are bounds on an unused type parameter)
 - rust-lang#93982 (Provide extra note if synthetic type args are specified)
 - rust-lang#94087 (Remove unused `unsound_ignore_borrow_on_drop`)
 - rust-lang#94235 (chalk: Fix wrong debrujin index in opaque type handling.)
 - rust-lang#94306 (Avoid exhausting stack space in dominator compression)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit d6ca388 into rust-lang:master Feb 26, 2022
@rustbot rustbot added this to the 1.61.0 milestone Feb 26, 2022
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.

5 participants