-impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for MonoItem<'tcx> {
- fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
- ::std::mem::discriminant(self).hash_stable(hcx, hasher);
-
- match *self {
- MonoItem::Fn(ref instance) => {
- instance.hash_stable(hcx, hasher);
- }
- MonoItem::Static(def_id) => {
- def_id.hash_stable(hcx, hasher);
- }
- MonoItem::GlobalAsm(item_id) => {
- hcx.with_node_id_hashing_mode(NodeIdHashingMode::HashDefPath, |hcx| {
- item_id.hash_stable(hcx, hasher);
- })
- }
- }
- }
-}
-