Derive Hash for hashable generated ADTs - #17
Open
uurl wants to merge 1 commit into
Open
Conversation
Signed-off-by: Raul Estrada <raulestradaa@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #16
Summary
Allow generated ADTs to participate in hash-based variable dumping when their fields are recursively hashable and deterministically printable.
Changes
Remove the unconditional ADT exclusion from
TyId::hashable().Continue excluding types containing floating-point values or pointers.
Add
Hashto the generated derive attributes for hashable ADTs.Add tests covering:
Rationale
The dump-variable logic already selects initialized locals using
TyId::hashable(). Generated ADTs were excluded because they did not deriveHash, even when all of their fields supported hashing.This change enables those ADTs without modifying the dumper ABI, memory model, or type-generation behavior.
Validation
cargo fmt --checkcargo buildRUST_LOG=debug cargo testcargo test -p mir serialize_hashable_adts -- --nocapture