Skip to content

Commit f1a7e1d

Browse files
committed
Iterate on stability.
1 parent 7a5620c commit f1a7e1d

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,7 @@ impl EncodeContext<'a, 'tcx> {
773773
if should_encode_visibility(def_kind) {
774774
record!(self.tables.visibility[def_id] <- self.tcx.visibility(def_id));
775775
}
776+
self.encode_stability(def_id);
776777
}
777778
}
778779

@@ -805,7 +806,6 @@ impl EncodeContext<'a, 'tcx> {
805806
f.did.index
806807
}));
807808
self.encode_ident_span(def_id, variant.ident);
808-
self.encode_stability(def_id);
809809
self.encode_deprecation(def_id);
810810
self.encode_item_type(def_id);
811811
if variant.ctor_kind == CtorKind::Fn {
@@ -836,7 +836,6 @@ impl EncodeContext<'a, 'tcx> {
836836
};
837837

838838
record!(self.tables.kind[def_id] <- EntryKind::Variant(self.lazy(data)));
839-
self.encode_stability(def_id);
840839
self.encode_deprecation(def_id);
841840
self.encode_item_type(def_id);
842841
if variant.ctor_kind == CtorKind::Fn {
@@ -893,7 +892,6 @@ impl EncodeContext<'a, 'tcx> {
893892
tcx.hir().local_def_id(item_id.id).local_def_index
894893
}));
895894
}
896-
self.encode_stability(def_id);
897895
self.encode_deprecation(def_id);
898896
}
899897

@@ -911,7 +909,6 @@ impl EncodeContext<'a, 'tcx> {
911909

912910
record!(self.tables.kind[def_id] <- EntryKind::Field);
913911
self.encode_ident_span(def_id, field.ident);
914-
self.encode_stability(def_id);
915912
self.encode_deprecation(def_id);
916913
self.encode_item_type(def_id);
917914
self.encode_generics(def_id);
@@ -932,7 +929,6 @@ impl EncodeContext<'a, 'tcx> {
932929
};
933930

934931
record!(self.tables.kind[def_id] <- EntryKind::Struct(self.lazy(data), adt_def.repr));
935-
self.encode_stability(def_id);
936932
self.encode_deprecation(def_id);
937933
self.encode_item_type(def_id);
938934
if variant.ctor_kind == CtorKind::Fn {
@@ -1035,7 +1031,6 @@ impl EncodeContext<'a, 'tcx> {
10351031
}
10361032
}
10371033
self.encode_ident_span(def_id, ast_item.ident);
1038-
self.encode_stability(def_id);
10391034
self.encode_const_stability(def_id);
10401035
self.encode_deprecation(def_id);
10411036
match trait_item.kind {
@@ -1136,7 +1131,6 @@ impl EncodeContext<'a, 'tcx> {
11361131
}
11371132
}
11381133
self.encode_ident_span(def_id, impl_item.ident);
1139-
self.encode_stability(def_id);
11401134
self.encode_const_stability(def_id);
11411135
self.encode_deprecation(def_id);
11421136
self.encode_item_type(def_id);
@@ -1411,7 +1405,6 @@ impl EncodeContext<'a, 'tcx> {
14111405
}
14121406
_ => {}
14131407
}
1414-
self.encode_stability(def_id);
14151408
self.encode_const_stability(def_id);
14161409
self.encode_deprecation(def_id);
14171410
match item.kind {
@@ -1495,7 +1488,6 @@ impl EncodeContext<'a, 'tcx> {
14951488
let def_id = self.tcx.hir().local_def_id(macro_def.hir_id).to_def_id();
14961489
record!(self.tables.kind[def_id] <- EntryKind::MacroDef(self.lazy(macro_def.ast.clone())));
14971490
self.encode_ident_span(def_id, macro_def.ident);
1498-
self.encode_stability(def_id);
14991491
self.encode_deprecation(def_id);
15001492
}
15011493

@@ -1823,7 +1815,6 @@ impl EncodeContext<'a, 'tcx> {
18231815
}
18241816
}
18251817
self.encode_ident_span(def_id, nitem.ident);
1826-
self.encode_stability(def_id);
18271818
self.encode_const_stability(def_id);
18281819
self.encode_deprecation(def_id);
18291820
self.encode_item_type(def_id);
@@ -1891,15 +1882,12 @@ impl EncodeContext<'a, 'tcx> {
18911882
let def_id = self.tcx.hir().local_def_id(param.hir_id);
18921883
match param.kind {
18931884
GenericParamKind::Lifetime { .. } => continue,
1894-
GenericParamKind::Type { ref default, .. } => {
1885+
GenericParamKind::Type { default, .. } => {
18951886
self.encode_info_for_generic_param(
18961887
def_id.to_def_id(),
18971888
EntryKind::TypeParam,
18981889
default.is_some(),
18991890
);
1900-
if default.is_some() {
1901-
self.encode_stability(def_id.to_def_id());
1902-
}
19031891
}
19041892
GenericParamKind::Const { .. } => {
19051893
self.encode_info_for_generic_param(

0 commit comments

Comments
 (0)