use crate::rustc_data_structures::stable_hash::{StableHash, StableHashCtxt, StableHasher};
use crate::rustc_hir::hir::{AttributeMap, OwnerInfo, OwnerNodes};
impl<'tcx> StableHash for OwnerNodes<'tcx> {
fn stable_hash<Hcx: StableHashCtxt>(&self, hcx: &mut Hcx, hasher: &mut StableHasher) {
let OwnerNodes { opt_hash, .. } = *self;
opt_hash.unwrap().stable_hash(hcx, hasher);
}
}
impl<'tcx> StableHash for AttributeMap<'tcx> {
fn stable_hash<Hcx: StableHashCtxt>(&self, hcx: &mut Hcx, hasher: &mut StableHasher) {
let AttributeMap { opt_hash, define_opaque: _, map: _ } = *self;
opt_hash.unwrap().stable_hash(hcx, hasher);
}
}
impl<'tcx> StableHash for OwnerInfo<'tcx> {
fn stable_hash<Hcx: StableHashCtxt>(&self, hcx: &mut Hcx, hasher: &mut StableHasher) {
let OwnerInfo { opt_hash, .. } = *self;
opt_hash.unwrap().stable_hash(hcx, hasher);
}
}