about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-02-06 10:36:23 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2021-03-17 17:30:50 +0100
commitfcd6f20700848d9220bae663b7a41cea4e94f280 (patch)
tree0286d88a66ffcf961a8888621f7d914ec0fd2bd5
parentc74a3553ae2b50d6ec11ff660240fe7ba882c65e (diff)
downloadrust-fcd6f20700848d9220bae663b7a41cea4e94f280.tar.gz
rust-fcd6f20700848d9220bae663b7a41cea4e94f280.zip
Iterate for super_predicates.
-rw-r--r--compiler/rustc_metadata/src/rmeta/encoder.rs14
1 files changed, 3 insertions, 11 deletions
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