1
Fork 0

Directly use AttributeMap inside OwnerInfo.

This commit is contained in:
Camille GILLOT 2021-09-12 11:41:35 +02:00
parent 1c7f85f17c
commit 41e80b85cf
8 changed files with 42 additions and 28 deletions

View file

@ -476,6 +476,13 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
let (nodes, parenting) =
index::index_hir(self.sess, self.resolver.definitions(), node, &bodies);
let nodes = hir::OwnerNodes { hash, node_hash, nodes, bodies };
let attrs = {
let mut hcx = self.resolver.create_stable_hashing_context();
let mut stable_hasher = StableHasher::new();
attrs.hash_stable(&mut hcx, &mut stable_hasher);
let hash = stable_hasher.finish();
hir::AttributeMap { map: attrs, hash }
};
hir::OwnerInfo { nodes, parenting, attrs, trait_map }
}