From 7a5620c63a3c2431777e93169cfaf9d1e32ca8e0 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 28 Nov 2020 22:12:56 +0100 Subject: [PATCH] Iterate DefId to encode expn_that_defined. --- compiler/rustc_metadata/src/rmeta/encoder.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index c80f70ae528..da611ab9c1c 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -769,6 +769,7 @@ fn encode_def_ids(&mut self) { }); record!(self.tables.span[def_id] <- tcx.def_span(def_id)); record!(self.tables.attributes[def_id] <- tcx.get_attrs(def_id)); + record!(self.tables.expn_that_defined[def_id] <- self.tcx.expansion_that_defined(def_id)); if should_encode_visibility(def_kind) { record!(self.tables.visibility[def_id] <- self.tcx.visibility(def_id)); } @@ -799,7 +800,6 @@ fn encode_enum_variant_info(&mut self, def: &ty::AdtDef, index: VariantIdx) { }; record!(self.tables.kind[def_id] <- EntryKind::Variant(self.lazy(data))); - record!(self.tables.expn_that_defined[def_id] <- self.tcx.expansion_that_defined(def_id)); record!(self.tables.children[def_id] <- variant.fields.iter().map(|f| { assert!(f.did.is_local()); f.did.index @@ -910,7 +910,6 @@ fn encode_field( debug!("EncodeContext::encode_field({:?})", def_id); record!(self.tables.kind[def_id] <- EntryKind::Field); - record!(self.tables.expn_that_defined[def_id] <- self.tcx.expansion_that_defined(def_id)); self.encode_ident_span(def_id, field.ident); self.encode_stability(def_id); self.encode_deprecation(def_id); @@ -933,7 +932,6 @@ fn encode_struct_ctor(&mut self, adt_def: &ty::AdtDef, def_id: DefId) { }; record!(self.tables.kind[def_id] <- EntryKind::Struct(self.lazy(data), adt_def.repr)); - record!(self.tables.expn_that_defined[def_id] <- self.tcx.expansion_that_defined(def_id)); self.encode_stability(def_id); self.encode_deprecation(def_id); self.encode_item_type(def_id); @@ -1380,7 +1378,6 @@ fn encode_info_for_item(&mut self, def_id: DefId, item: &'tcx hir::Item<'tcx>) { } }; record!(self.tables.kind[def_id] <- entry_kind); - record!(self.tables.expn_that_defined[def_id] <- self.tcx.expansion_that_defined(def_id)); // FIXME(eddyb) there should be a nicer way to do this. match item.kind { hir::ItemKind::ForeignMod { items, .. } => record!(self.tables.children[def_id] <-