1
Fork 0

Auto merge of #83723 - cjgillot:ownernode, r=petrochenkov

Store all HIR owners in the same container

This replaces the previous storage in a BTreeMap for each of Item/ImplItem/TraitItem/ForeignItem.
This should allow for a more compact storage.

Based on https://github.com/rust-lang/rust/pull/83114
This commit is contained in:
bors 2021-07-25 11:11:02 +00:00
commit 6489ee1041
34 changed files with 579 additions and 486 deletions

View file

@ -439,7 +439,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
fn encode_info_for_items(&mut self) {
let krate = self.tcx.hir().krate();
self.encode_info_for_mod(CRATE_DEF_ID, &krate.item);
self.encode_info_for_mod(CRATE_DEF_ID, krate.module());
// Proc-macro crates only export proc-macro items, which are looked
// up using `proc_macro_data`
@ -448,7 +448,7 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
}
krate.visit_all_item_likes(&mut self.as_deep_visitor());
for macro_def in krate.exported_macros {
for macro_def in krate.exported_macros() {
self.visit_macro_def(macro_def);
}
}