diff --git a/compiler/rustc_metadata/src/rmeta/encoder.rs b/compiler/rustc_metadata/src/rmeta/encoder.rs index 1dd5aac9267..254954c8376 100644 --- a/compiler/rustc_metadata/src/rmeta/encoder.rs +++ b/compiler/rustc_metadata/src/rmeta/encoder.rs @@ -947,6 +947,9 @@ impl EncodeContext<'a, 'tcx> { record!(self.tables.inferred_outlives[def_id] <- inferred_outlives); } } + if let DefKind::Trait | DefKind::TraitAlias = def_kind { + record!(self.tables.super_predicates[def_id] <- self.tcx.super_predicates_of(def_id)); + } } let inherent_impls = tcx.crate_inherent_impls(LOCAL_CRATE); for (def_id, implementations) in inherent_impls.inherent_impls.iter() { @@ -1092,11 +1095,6 @@ impl EncodeContext<'a, 'tcx> { } } - fn encode_super_predicates(&mut self, def_id: DefId) { - debug!("EncodeContext::encode_super_predicates({:?})", def_id); - record!(self.tables.super_predicates[def_id] <- self.tcx.super_predicates_of(def_id)); - } - fn encode_explicit_item_bounds(&mut self, def_id: DefId) { debug!("EncodeContext::encode_explicit_item_bounds({:?})", def_id); let bounds = self.tcx.explicit_item_bounds(def_id); @@ -1493,12 +1491,6 @@ impl EncodeContext<'a, 'tcx> { record!(self.tables.impl_trait_ref[def_id] <- trait_ref); } } - match item.kind { - hir::ItemKind::Trait(..) | hir::ItemKind::TraitAlias(..) => { - self.encode_super_predicates(def_id); - } - _ => {} - } } /// Serialize the text of exported macros