-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Hash of Discriminant now produces different results across CPU architectures #74215
Copy link
Copy link
Closed
Closed
Copy link
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.Call for participation: Help is requested to fix this issue.P-mediumMedium priorityMedium priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Hi, we just noticed that there has been changes to the inner of
Discriminant, i.e.DiscriminantKind,that causes a
Hashof a discriminant to produce different results across CPU architectures.E.g.
When hashing this in the current stable one gets writes that look like this:
And depending on the architecture in the current nightly one gets for
armv7-unknown-linux-gnueabihf:However for ex
x86_64-unknown-linux-gnuit is still 8 bytes as before.This is a problem as e.g. CRC hashes are no longer compatible between CPU architectures.
Not sure if this was intended, but it seems like a breaking change to me?
In our case we are sending structures between an embedded
thumbv7em-none-eabihfand anarmv7-unknown-linux-gnueabihfsystem where CRCs are calculated based on#[derive(Hash)]for said structures to be sent.
rustc --version --verbose: