-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustc: More fixes for arch-independent hashing #36866
Conversation
r? @eddyb |
(rust_highfive has picked a reviewer for you, use r? to override) |
The description is no longer accurate and this sadly doesn't fix the symbol case, which is in librustc_trans/back/symbol_names.rs. If the wrapper would be generic then it'd work for symbols as well (and could be required by |
64cd93c
to
61a0ae0
Compare
@eddyb hm I'm... not sure how it worked? I wonder if maybe I tested the wrong thing? In any case I've updated with a generic wrapper which is unconditionally used by |
@alexcrichton Looks great! r=me with updated PR description. |
61a0ae0
to
d690f1e
Compare
@bors: r=eddyb p=1 (higher priority for fixing a regression) |
📌 Commit d690f1e has been approved by |
Adding impl<'a> Hasher for Sha256Hasher<'a> {
fn write_usize(&mut self, i: usize) { bug!("can't do that here") }
fn write_isize(&mut self, i: isize) { bug!("can't do that here") }
} in
|
@TimNN yeah I found that the rabbit hole went pretty deep if we tried to avoid |
@alexcrichton: That |
It's hashing something before creating the |
Oh yeah: https://github.com/rust-lang/rust/blob/master/src/librustc_trans/back/symbol_names.rs#L160. |
Doing it only in |
@TimNN I meant on top of the current PR. |
@eddyb: Ah, then I misunderstood that part of your comment 😄 |
⌛ Testing commit d690f1e with merge fc02ed5... |
In another attempt to fix rust-lang#36793 this commit attempts to head off any future problems by adding a custom `WidentUsizeHasher` which will widen any hashing of `isize` and `usize` to a `u64` as necessary. This obviates the need for a previous number of `as u64` annotations and will hopefully protect us against future problems here. Closes rust-lang#36793 (hopefully)
d690f1e
to
faae99d
Compare
@bors: r=eddyb force clean |
📌 Commit faae99d has been approved by |
rustc: More fixes for arch-independent hashing In another attempt to fix #36793 this commit attempts to head off any future problems by adding a custom `WidentUsizeHasher` which will widen any hashing of `isize` and `usize` to a `u64` as necessary. This obviates the need for a previous number of `as u64` annotations and will hopefully protect us against future problems here. Closes #36793 (hopefully)
Accepting for backport since it fixes some nasty problems. |
In another attempt to fix #36793 this commit attempts to head off any future
problems by adding a custom
WidentUsizeHasher
which will widen any hashing ofisize
andusize
to au64
as necessary. This obviates the need for aprevious number of
as u64
annotations and will hopefully protect us againstfuture problems here.
Closes #36793 (hopefully)