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

Handle infer vars in anon consts on stable #132971

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

BoxyUwU
Copy link
Member

@BoxyUwU BoxyUwU commented Nov 12, 2024

Fixes #132955

Diagnostics will sometimes try to replace generic parameters with inference variables in failing goals. This means that if we have some failing goal with an array repeat expr count anon const in it, we will wind up with some ty::ConstKind::Unevaluated(anon_const_def, [?x]) during diagnostics which will then ICE if we do not handle inference variables correctly on stable when normalizing type system consts.

r? @compiler-errors

@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 Nov 12, 2024
Comment on lines +328 to +330
ConstKind::Expr(_) => {
bug!("Normalization of `ty::ConstKind::Expr` is unimplemented")
}
Copy link
Member Author

@BoxyUwU BoxyUwU Nov 12, 2024

Choose a reason for hiding this comment

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

Unrelated change: just wanted a better ICE message here so that it's easier to tell that any ICEs from here are caused by generic_const_exprs not some problem with not calling normalize here (#132960). I can split this out if you want but it felt a little silly to make a separate PR just to change an ICE message when I already have to make a PR to make a follow up change to the previous PR.

Copy link
Member Author

@BoxyUwU BoxyUwU left a comment

Choose a reason for hiding this comment

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

.

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Nov 13, 2024

📌 Commit 6dad074 has been approved by compiler-errors

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 Nov 13, 2024
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 13, 2024
…ts, r=compiler-errors

Handle infer vars in anon consts on stable

Fixes rust-lang#132955

Diagnostics will sometimes try to replace generic parameters with inference variables in failing goals. This means that if we have some failing goal with an array repeat expr count anon const in it, we will wind up with some `ty::ConstKind::Unevaluated(anon_const_def, [?x])` during diagnostics which will then ICE if we do not handle inference variables correctly on stable when normalizing type system consts.

r? `@compiler-errors`
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2024
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#132709 (optimize char::to_digit and assert radix is at least 2)
 - rust-lang#132842 (ABI checks: add support for tier2 arches)
 - rust-lang#132965 (allow CFGuard on windows-gnullvm)
 - rust-lang#132967 (fix REGISTRY_USERNAME to reuse cache between auto and pr jobs)
 - rust-lang#132971 (Handle infer vars in anon consts on stable)
 - rust-lang#132979 (use `--exact` on `--skip` to avoid unintended substring matches)

r? `@ghost`
`@rustbot` modify labels: rollup
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Nov 13, 2024
…ts, r=compiler-errors

Handle infer vars in anon consts on stable

Fixes rust-lang#132955

Diagnostics will sometimes try to replace generic parameters with inference variables in failing goals. This means that if we have some failing goal with an array repeat expr count anon const in it, we will wind up with some `ty::ConstKind::Unevaluated(anon_const_def, [?x])` during diagnostics which will then ICE if we do not handle inference variables correctly on stable when normalizing type system consts.

r? ``@compiler-errors``
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2024
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#132709 (optimize char::to_digit and assert radix is at least 2)
 - rust-lang#132842 (ABI checks: add support for tier2 arches)
 - rust-lang#132965 (allow CFGuard on windows-gnullvm)
 - rust-lang#132967 (fix REGISTRY_USERNAME to reuse cache between auto and pr jobs)
 - rust-lang#132971 (Handle infer vars in anon consts on stable)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2024
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#132709 (optimize char::to_digit and assert radix is at least 2)
 - rust-lang#132842 (ABI checks: add support for tier2 arches)
 - rust-lang#132965 (allow CFGuard on windows-gnullvm)
 - rust-lang#132967 (fix REGISTRY_USERNAME to reuse cache between auto and pr jobs)
 - rust-lang#132971 (Handle infer vars in anon consts on stable)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 13, 2024
…llaumeGomez

Rollup of 5 pull requests

Successful merges:

 - rust-lang#132709 (optimize char::to_digit and assert radix is at least 2)
 - rust-lang#132842 (ABI checks: add support for tier2 arches)
 - rust-lang#132965 (allow CFGuard on windows-gnullvm)
 - rust-lang#132967 (fix REGISTRY_USERNAME to reuse cache between auto and pr jobs)
 - rust-lang#132971 (Handle infer vars in anon consts on stable)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 14, 2024
…kingjubilee

Rollup of 7 pull requests

Successful merges:

 - rust-lang#131304 (float types: move copysign, abs, signum to libcore)
 - rust-lang#132907 (Change intrinsic declarations to new style)
 - rust-lang#132971 (Handle infer vars in anon consts on stable)
 - rust-lang#133003 (Make `CloneToUninit` dyn-compatible)
 - rust-lang#133004 (btree: simplify the backdoor between set and map)
 - rust-lang#133008 (update outdated comment about test-float-parse)
 - rust-lang#133012 (Add test cases for rust-lang#125918)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit aa18946 into rust-lang:master Nov 14, 2024
6 checks passed
@rustbot rustbot added this to the 1.84.0 milestone Nov 14, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 14, 2024
Rollup merge of rust-lang#132971 - BoxyUwU:handle_infers_in_anon_consts, r=compiler-errors

Handle infer vars in anon consts on stable

Fixes rust-lang#132955

Diagnostics will sometimes try to replace generic parameters with inference variables in failing goals. This means that if we have some failing goal with an array repeat expr count anon const in it, we will wind up with some `ty::ConstKind::Unevaluated(anon_const_def, [?x])` during diagnostics which will then ICE if we do not handle inference variables correctly on stable when normalizing type system consts.

r? ```@compiler-errors```
BLANKatGITHUB pushed a commit to BLANKatGITHUB/rust that referenced this pull request Nov 14, 2024
…kingjubilee

Rollup of 7 pull requests

Successful merges:

 - rust-lang#131304 (float types: move copysign, abs, signum to libcore)
 - rust-lang#132907 (Change intrinsic declarations to new style)
 - rust-lang#132971 (Handle infer vars in anon consts on stable)
 - rust-lang#133003 (Make `CloneToUninit` dyn-compatible)
 - rust-lang#133004 (btree: simplify the backdoor between set and map)
 - rust-lang#133008 (update outdated comment about test-float-parse)
 - rust-lang#133012 (Add test cases for rust-lang#125918)

r? `@ghost`
`@rustbot` modify labels: rollup
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: did not expect inference variables here
4 participants