Skip to content

Conversation

@fredszaq
Copy link

@fredszaq fredszaq commented Jan 7, 2026

Synopsis

This PR adds a new derive for the Hash trait. This does mostly the same as the derive bundled with rust std but with a few niceties :

  • no overcontrain of generic types
  • possibility to ignore fields with #[hash(skip)] (also honors #[eq(skip)] and #[partial_eq(skip)] to ensure trait expectations)
  • possibility to use custom hash function on fields with #[hash(with(my_custom_hash_function)]

Solution

I used the PartialEq derive as an example to implement this, didn't have to do exotic things to get things to work

Checklist

  • Documentation is updated (if required)
  • Tests are added/updated (if required)
  • CHANGELOG entry is added (if required)

@tyranron tyranron added feature New derive or feature k::api Related to API (application interface) labels Jan 8, 2026
@tyranron tyranron added this to the next milestone Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New derive or feature k::api Related to API (application interface)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants