Move parenting info to index_hir.
This commit is contained in:
parent
99d3798b6c
commit
18bffdb10e
6 changed files with 54 additions and 42 deletions
|
@ -28,21 +28,18 @@ struct HirOwnerData<'hir> {
|
|||
#[derive(Debug)]
|
||||
pub struct IndexedHir<'hir> {
|
||||
map: IndexVec<LocalDefId, HirOwnerData<'hir>>,
|
||||
parenting: FxHashMap<LocalDefId, HirId>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct Owner<'tcx> {
|
||||
parent: HirId,
|
||||
node: Node<'tcx>,
|
||||
}
|
||||
|
||||
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for Owner<'tcx> {
|
||||
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
|
||||
let Owner { node, parent } = self;
|
||||
hcx.while_hashing_hir_bodies(false, |hcx| {
|
||||
parent.hash_stable(hcx, hasher);
|
||||
node.hash_stable(hcx, hasher)
|
||||
});
|
||||
let Owner { node } = self;
|
||||
hcx.while_hashing_hir_bodies(false, |hcx| node.hash_stable(hcx, hasher));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue