-
Notifications
You must be signed in to change notification settings - Fork 13.3k
[do not merge] Tweak TokenStream
's PartialEq
and HashStable
impls
#97182
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
Conversation
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) { | ||
for sub_tt in self.trees() { | ||
sub_tt.hash_stable(hcx, hasher); | ||
for (tt, spacing) in self.0.iter() { | ||
tt.hash_stable(hcx, hasher); | ||
spacing.hash_stable(hcx, hasher); | ||
} | ||
} |
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.
Question was already raised before: why only hash TokenTree
s? https://github.com/rust-lang/rust/pull/66279/files#r349855691
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.
Maybe this is answer:
rust/compiler/rustc_data_structures/src/stable_hasher.rs
Lines 196 to 200 in c067287
/// (e.g. `Hash`). In practice this means that `hash_stable` must feed any | |
/// information into the hasher that a `PartialEq` comparison takes into | |
/// account. See [#49300](https://github.com/rust-lang/rust/issues/49300) | |
/// for an example where violating this invariant has caused trouble in the | |
/// past. |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #99887) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @ghost