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

Nuke the const_to_allocation query #53850

Merged
merged 4 commits into from
Sep 1, 2018
Merged

Conversation

csmoe
Copy link
Member

@csmoe csmoe commented Aug 31, 2018

Closes #53847
r? @RalfJung
./x.py check works anyway, let's checkout tests from ci.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 31, 2018
if let ConstValue::ByRef(_, allocation, _) = const_val.val {
allocation
} else {
panic!("Trying to get allocation info from non-byref const value")
Copy link
Member

Choose a reason for hiding this comment

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

This should say something about getting a non-ByRef static. That's violation of an invariant.

let alloc = if let ConstValue::ByRef(_, allocation, _) = static_.val {
allocation
} else {
panic!("Trying to get allocation info from non-byref const value")
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

@RalfJung
Copy link
Member

CI is good, and I am happy as well except for the two nits. :)

if let ConstValue::ByRef(_, allocation, _) = const_val.val {
allocation
} else {
panic!("Matching on non-ByRef static")
Copy link
Member

Choose a reason for hiding this comment

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

Actually, now that I think about this, could you replace panic! by bug! as well (in both cases)? That's what we usually do in the compiler for invariant violations. Sorry I didn't think of that yesterday.

@RalfJung
Copy link
Member

RalfJung commented Sep 1, 2018

Thanks!

@bors r+ rollup+

@bors
Copy link
Contributor

bors commented Sep 1, 2018

📌 Commit db7da0e has been approved by RalfJung

@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 1, 2018
@RalfJung
Copy link
Member

RalfJung commented Sep 1, 2018

@bors p=rollup

I never know how to do this...

@pietroalbini
Copy link
Member

@bors rollup

kennytm added a commit to kennytm/rust that referenced this pull request Sep 1, 2018
Nuke the `const_to_allocation` query

Closes rust-lang#53847
r? @RalfJung
`./x.py check` works anyway, let's checkout tests from ci.
bors added a commit that referenced this pull request Sep 1, 2018
Rollup of 9 pull requests

Successful merges:

 - #53076 (set cfg(rustdoc) when rustdoc is running on a crate)
 - #53622 (cleanup: Add main functions to some UI tests)
 - #53769 (Also link Clippy repo in the CONTRIBUTING.md file)
 - #53774 (Add rust-gdbgui script.)
 - #53781 (bench: libcore: fix build failure of any.rs benchmark (use "dyn Any"))
 - #53782 (Make Arc cloning mechanics clearer in module docs)
 - #53790 (Add regression test for issue #52060)
 - #53801 (Prevent duplicated impl on foreign types)
 - #53850 (Nuke the `const_to_allocation` query)
@bors bors merged commit db7da0e into rust-lang:master Sep 1, 2018
@csmoe csmoe deleted the const_to_alloc branch September 1, 2018 21:40
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.

5 participants