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

add case for checking const refs in check_const_value_eq #89147

Merged
merged 1 commit into from
Sep 22, 2021

Conversation

b-naber
Copy link
Contributor

@b-naber b-naber commented Sep 21, 2021

Previously in check_const_value_eq we destructured ConstValue::ByRef instances, this didn't account for ty::Refs however, which led to an ICE.

Fixes #88876
Fixes #88384

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 21, 2021
@rust-log-analyzer

This comment has been minimized.

@b-naber b-naber force-pushed the refs_in_check_const_value_eq branch from 71ed0db to 999888c Compare September 21, 2021 13:50
if a.ty.is_ref() || b.ty.is_ref() =>
{
if a.ty.is_ref() && b.ty.is_ref() {
alloc_a == alloc_b
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to have weird effects, but not worse than the Scalar::Ptr arm above. We should be using deref_const in both cases. But there's no need to try to fix this, we can just wait until I finally get my valtree PR over the finish line.

@oli-obk
Copy link
Contributor

oli-obk commented Sep 21, 2021

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Sep 21, 2021

📌 Commit 999888c 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 Sep 21, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 21, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#88795 (Print a note if a character literal contains a variation selector)
 - rust-lang#89015 (core::ascii::escape_default: reduce struct size)
 - rust-lang#89078 (Cleanup: Remove needless reference in ParentHirIterator)
 - rust-lang#89086 (Stabilize `Iterator::map_while`)
 - rust-lang#89096 ([bootstrap] Improve the error message when `ninja` is not found to link to installation instructions)
 - rust-lang#89113 (dont `.ensure()` the `thir_abstract_const` query call in `mir_build`)
 - rust-lang#89114 (Fixes a technicality regarding the size of C's `char` type)
 - rust-lang#89115 (:arrow_up: rust-analyzer)
 - rust-lang#89126 (Fix ICE when `indirect_structural_match` is allowed)
 - rust-lang#89141 (Impl `Error` for `FromSecsError` without foreign type)
 - rust-lang#89142 (Fix match for placeholder region)
 - rust-lang#89147 (add case for checking const refs in check_const_value_eq)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a3e6c19 into rust-lang:master Sep 22, 2021
@rustbot rustbot added this to the 1.57.0 milestone Sep 22, 2021
@b-naber b-naber deleted the refs_in_check_const_value_eq branch September 22, 2021 08:16
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 28, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#88795 (Print a note if a character literal contains a variation selector)
 - rust-lang#89015 (core::ascii::escape_default: reduce struct size)
 - rust-lang#89078 (Cleanup: Remove needless reference in ParentHirIterator)
 - rust-lang#89086 (Stabilize `Iterator::map_while`)
 - rust-lang#89096 ([bootstrap] Improve the error message when `ninja` is not found to link to installation instructions)
 - rust-lang#89113 (dont `.ensure()` the `thir_abstract_const` query call in `mir_build`)
 - rust-lang#89114 (Fixes a technicality regarding the size of C's `char` type)
 - rust-lang#89115 (:arrow_up: rust-analyzer)
 - rust-lang#89126 (Fix ICE when `indirect_structural_match` is allowed)
 - rust-lang#89141 (Impl `Error` for `FromSecsError` without foreign type)
 - rust-lang#89142 (Fix match for placeholder region)
 - rust-lang#89147 (add case for checking const refs in check_const_value_eq)

Failed merges:

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE adt_const_params with slice of static str ICE on const generic + static slice of fn()
6 participants