Iterate on stability.

This commit is contained in:
Camille GILLOT 2020-12-06 22:20:24 +01:00
parent 7a5620c63a
commit f1a7e1df3a

View File

@ -773,6 +773,7 @@ fn encode_def_ids(&mut self) {
if should_encode_visibility(def_kind) { if should_encode_visibility(def_kind) {
record!(self.tables.visibility[def_id] <- self.tcx.visibility(def_id)); record!(self.tables.visibility[def_id] <- self.tcx.visibility(def_id));
} }
self.encode_stability(def_id);
} }
} }
@ -805,7 +806,6 @@ fn encode_enum_variant_info(&mut self, def: &ty::AdtDef, index: VariantIdx) {
f.did.index f.did.index
})); }));
self.encode_ident_span(def_id, variant.ident); self.encode_ident_span(def_id, variant.ident);
self.encode_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
self.encode_item_type(def_id); self.encode_item_type(def_id);
if variant.ctor_kind == CtorKind::Fn { if variant.ctor_kind == CtorKind::Fn {
@ -836,7 +836,6 @@ fn encode_enum_variant_ctor(&mut self, def: &ty::AdtDef, index: VariantIdx) {
}; };
record!(self.tables.kind[def_id] <- EntryKind::Variant(self.lazy(data))); record!(self.tables.kind[def_id] <- EntryKind::Variant(self.lazy(data)));
self.encode_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
self.encode_item_type(def_id); self.encode_item_type(def_id);
if variant.ctor_kind == CtorKind::Fn { if variant.ctor_kind == CtorKind::Fn {
@ -893,7 +892,6 @@ fn encode_info_for_mod(&mut self, id: hir::HirId, md: &hir::Mod<'_>) {
tcx.hir().local_def_id(item_id.id).local_def_index tcx.hir().local_def_id(item_id.id).local_def_index
})); }));
} }
self.encode_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
} }
@ -911,7 +909,6 @@ fn encode_field(
record!(self.tables.kind[def_id] <- EntryKind::Field); record!(self.tables.kind[def_id] <- EntryKind::Field);
self.encode_ident_span(def_id, field.ident); self.encode_ident_span(def_id, field.ident);
self.encode_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
self.encode_item_type(def_id); self.encode_item_type(def_id);
self.encode_generics(def_id); self.encode_generics(def_id);
@ -932,7 +929,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.kind[def_id] <- EntryKind::Struct(self.lazy(data), adt_def.repr));
self.encode_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
self.encode_item_type(def_id); self.encode_item_type(def_id);
if variant.ctor_kind == CtorKind::Fn { if variant.ctor_kind == CtorKind::Fn {
@ -1035,7 +1031,6 @@ fn encode_info_for_trait_item(&mut self, def_id: DefId) {
} }
} }
self.encode_ident_span(def_id, ast_item.ident); self.encode_ident_span(def_id, ast_item.ident);
self.encode_stability(def_id);
self.encode_const_stability(def_id); self.encode_const_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
match trait_item.kind { match trait_item.kind {
@ -1136,7 +1131,6 @@ fn encode_info_for_impl_item(&mut self, def_id: DefId) {
} }
} }
self.encode_ident_span(def_id, impl_item.ident); self.encode_ident_span(def_id, impl_item.ident);
self.encode_stability(def_id);
self.encode_const_stability(def_id); self.encode_const_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
self.encode_item_type(def_id); self.encode_item_type(def_id);
@ -1411,7 +1405,6 @@ fn encode_info_for_item(&mut self, def_id: DefId, item: &'tcx hir::Item<'tcx>) {
} }
_ => {} _ => {}
} }
self.encode_stability(def_id);
self.encode_const_stability(def_id); self.encode_const_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
match item.kind { match item.kind {
@ -1495,7 +1488,6 @@ fn encode_info_for_macro_def(&mut self, macro_def: &hir::MacroDef<'_>) {
let def_id = self.tcx.hir().local_def_id(macro_def.hir_id).to_def_id(); let def_id = self.tcx.hir().local_def_id(macro_def.hir_id).to_def_id();
record!(self.tables.kind[def_id] <- EntryKind::MacroDef(self.lazy(macro_def.ast.clone()))); record!(self.tables.kind[def_id] <- EntryKind::MacroDef(self.lazy(macro_def.ast.clone())));
self.encode_ident_span(def_id, macro_def.ident); self.encode_ident_span(def_id, macro_def.ident);
self.encode_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
} }
@ -1823,7 +1815,6 @@ fn encode_info_for_foreign_item(&mut self, def_id: DefId, nitem: &hir::ForeignIt
} }
} }
self.encode_ident_span(def_id, nitem.ident); self.encode_ident_span(def_id, nitem.ident);
self.encode_stability(def_id);
self.encode_const_stability(def_id); self.encode_const_stability(def_id);
self.encode_deprecation(def_id); self.encode_deprecation(def_id);
self.encode_item_type(def_id); self.encode_item_type(def_id);
@ -1891,15 +1882,12 @@ fn encode_info_for_generics(&mut self, generics: &hir::Generics<'tcx>) {
let def_id = self.tcx.hir().local_def_id(param.hir_id); let def_id = self.tcx.hir().local_def_id(param.hir_id);
match param.kind { match param.kind {
GenericParamKind::Lifetime { .. } => continue, GenericParamKind::Lifetime { .. } => continue,
GenericParamKind::Type { ref default, .. } => { GenericParamKind::Type { default, .. } => {
self.encode_info_for_generic_param( self.encode_info_for_generic_param(
def_id.to_def_id(), def_id.to_def_id(),
EntryKind::TypeParam, EntryKind::TypeParam,
default.is_some(), default.is_some(),
); );
if default.is_some() {
self.encode_stability(def_id.to_def_id());
}
} }
GenericParamKind::Const { .. } => { GenericParamKind::Const { .. } => {
self.encode_info_for_generic_param( self.encode_info_for_generic_param(