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

Normalize consts' tys when relating with adt_const_params #97709

Merged
merged 1 commit into from
Jun 13, 2022

Conversation

compiler-errors
Copy link
Member

Fixes #97007

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jun 3, 2022
@rust-highfive
Copy link
Collaborator

r? @michaelwoerister

(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 Jun 3, 2022
@michaelwoerister
Copy link
Member

r? @oli-obk

let a_ty;
let b_ty;
if relation.tcx().features().adt_const_params {
a_ty = tcx.normalize_erasing_regions(relation.param_env(), a.ty());
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe normalize_erasing_regions can panic if normalization fails. Is is guaranteed that this succeeds here (otherwise you might want to use try_normalize_erasing_regions)?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think the only way it can fail is if there were other errors already. I'd rather address the ICE here if that happens and know about it than silently assume normalization can fail here.

@oli-obk
Copy link
Contributor

oli-obk commented Jun 13, 2022

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 13, 2022

📌 Commit 27af8e4 has been approved by oli-obk

@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 13, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jun 13, 2022
…am-ty, r=oli-obk

Normalize consts' tys when relating with `adt_const_params`

Fixes rust-lang#97007
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 13, 2022
…askrgr

Rollup of 10 pull requests

Successful merges:

 - rust-lang#97709 (Normalize consts' tys when relating with `adt_const_params`)
 - rust-lang#97875 (Remove the `infer_static_outlives_requirements` feature)
 - rust-lang#97960 (interpret: unify offset_from check with offset check)
 - rust-lang#97999 (Make `type_changing_struct_update` no longer an incomplete feature)
 - rust-lang#98043 (Remove unnecessary `to_string` and `String::new`)
 - rust-lang#98044 ([issues:97981] del unrelated comment)
 - rust-lang#98049 (Document an edge case of `str::split_once`)
 - rust-lang#98050 (Add some more regression tests for rust-lang#67945)
 - rust-lang#98054 (Fix error message for `download-ci-llvm`)
 - rust-lang#98057 (Update miri)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit e13eeed into rust-lang:master Jun 13, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 13, 2022
@compiler-errors compiler-errors deleted the normalize-const-param-ty branch August 11, 2023 20:11
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] "cannot relate constants of different types" with feature(adt_const_params, generic_const_exprs)
7 participants