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

Just derive Hashstable in librustc #66457

Merged
merged 8 commits into from
Nov 20, 2019
Merged

Conversation

cjgillot
Copy link
Contributor

Split out of #66279

r? @Zoxc

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 15, 2019
@@ -827,3 +831,21 @@ impl<'mir, 'tcx, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
frames
}
}

impl<'ctx, 'mir, 'tcx, Tag, Extra> HashStable<StableHashingContext<'ctx>>
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did this impl come from?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I expanded the macro because I planned to remove it in a subsequent commit. I can revert this.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, maybe just revert it from this PR and leave it for later.

instance,
span,
return_to_block,
return_place -> (return_place.as_ref().map(|r| &**r)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I see the impl was here.

@oli-obk What is going on here? Is this ignoring part of the frame for hashing?

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure what's going on here, but there's nothing being ignored. Maybe it's just some missing impls?

Copy link
Contributor

Choose a reason for hiding this comment

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

It seems to me it's skipping the layout field of PlaceTy. Is that intentional? If so, could it be skipped on the impl for PlaceTy?

@Zoxc
Copy link
Contributor

Zoxc commented Nov 15, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Nov 15, 2019

📌 Commit f2b687da5488ea5170d7e1abd3e8f16580eecbbe has been approved by Zoxc

@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 15, 2019
@bors
Copy link
Contributor

bors commented Nov 17, 2019

☔ The latest upstream changes (presumably #66384) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 17, 2019
@Zoxc
Copy link
Contributor

Zoxc commented Nov 18, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Nov 18, 2019

📌 Commit 279d2dbf3815acb1be416feeb44890ec5c61d659 has been approved by Zoxc

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 18, 2019
@Zoxc
Copy link
Contributor

Zoxc commented Nov 18, 2019

@cjgillot Github doesn't give notifications for pushes / rebases so you'll need to tell us about those.

@bors
Copy link
Contributor

bors commented Nov 19, 2019

☔ The latest upstream changes (presumably #66454) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 19, 2019
@cjgillot
Copy link
Contributor Author

Rebased.

@@ -1848,6 +1847,7 @@ pub struct VariantDef {
/// If this variant is a struct variant, then this is `None`.
pub ctor_def_id: Option<DefId>,
/// Variant or struct name.
#[stable_hasher(project(name))]
Copy link
Contributor

Choose a reason for hiding this comment

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

@michaelwoerister Why are we hashing only the name and not the span here? Was this something needed for gensyms?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it was somehow related to gensyms. Looks like we can just hash the entire Ident now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In an earlier draft, I forgot the projection attribute. As a result, some tests failed: #66279 (comment) . I did not investigate further.

@Zoxc
Copy link
Contributor

Zoxc commented Nov 20, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Nov 20, 2019

📌 Commit 579625b has been approved by Zoxc

@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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 20, 2019
Centril added a commit to Centril/rust that referenced this pull request Nov 20, 2019
bors added a commit that referenced this pull request Nov 20, 2019
Rollup of 7 pull requests

Successful merges:

 - #66060 (Making ICEs and test them in incremental)
 - #66298 (rustdoc: fixes #64305: disable search field instead of hidding it)
 - #66457 (Just derive Hashstable in librustc)
 - #66496 (rustc_metadata: Privatize more things)
 - #66514 (Fix selected crate search filter)
 - #66535 (Avoid ICE when `break`ing to an unreachable label)
 - #66573 (Ignore run-make reproducible-build-2 on Mac)

Failed merges:

r? @ghost
@bors bors merged commit 579625b into rust-lang:master Nov 20, 2019
@cjgillot cjgillot deleted the just_hashstable branch November 21, 2019 17:53
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.

6 participants