-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Properly hash enums #4066
Properly hash enums #4066
Conversation
return e.hash(&mut self.s); | ||
} | ||
|
||
std::mem::discriminant(&e.node).hash(&mut self.s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we use mem::discriminant we don't need the let c: fn
stuff below
@bors r+ |
📌 Commit b30c6dc has been approved by |
Properly hash enums While I wrote this I was saved by a clippy lint... I accidentally fetched the discriminant of a reference to an enum and not of an enum. changelog: reduce hash collisions during clippy-internal hashing
💔 Test failed - status-appveyor |
☔ The latest upstream changes (presumably #4080) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -635,24 +580,15 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> { | |||
pub fn hash_stmt(&mut self, b: &Stmt) { | |||
match b.node { | |||
StmtKind::Local(ref local) => { | |||
let c: fn(_) -> _ = StmtKind::Local; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By removing this, the discriminant needs to be hashed at the beginning of the function. I'll add this.
@bors r=Manishearth |
📌 Commit 5dea5d4 has been approved by |
Properly hash enums While I wrote this I was saved by a clippy lint... I accidentally fetched the discriminant of a reference to an enum and not of an enum. changelog: reduce hash collisions during clippy-internal hashing
Looks like bors did not merge the PR? @bors retry |
Properly hash enums While I wrote this I was saved by a clippy lint... I accidentally fetched the discriminant of a reference to an enum and not of an enum. changelog: reduce hash collisions during clippy-internal hashing
Bors was redeployed yesterday, maybe timing wasn't good. |
☀️ Test successful - checks-travis, status-appveyor |
While I wrote this I was saved by a clippy lint... I accidentally fetched the discriminant of a reference to an enum and not of an enum.
changelog: reduce hash collisions during clippy-internal hashing