break_hash_example/
lib.rs

1use std::hash::{Hash, Hasher};
2
3#[derive(Eq, PartialEq, Debug)]
4pub struct MyType(pub i32);
5
6impl Hash for MyType {
7    fn hash<H: Hasher>(&self, state: &mut H) {
8        // New hash: reverse the value
9        (!self.0).hash(state);
10    }
11}