Skip to content

Commit 45a9a54

Browse files
committed
Encode Trait info in def-id loop.
1 parent 1a9d34f commit 45a9a54

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

compiler/rustc_metadata/src/rmeta/encoder.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,9 +1407,15 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
14071407
record!(self.tables.object_lifetime_default[def_id] <- default);
14081408
}
14091409
if let DefKind::Trait = def_kind {
1410+
record!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id));
14101411
record!(self.tables.super_predicates_of[def_id] <- self.tcx.super_predicates_of(def_id));
1412+
1413+
let module_children = self.tcx.module_children_local(local_id);
1414+
record_array!(self.tables.module_children_non_reexports[def_id] <-
1415+
module_children.iter().map(|child| child.res.def_id().index));
14111416
}
14121417
if let DefKind::TraitAlias = def_kind {
1418+
record!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id));
14131419
record!(self.tables.super_predicates_of[def_id] <- self.tcx.super_predicates_of(def_id));
14141420
record!(self.tables.implied_predicates_of[def_id] <- self.tcx.implied_predicates_of(def_id));
14151421
}
@@ -1723,18 +1729,10 @@ impl<'a, 'tcx> EncodeContext<'a, 'tcx> {
17231729
}
17241730
}
17251731
}
1726-
hir::ItemKind::Trait(..) => {
1727-
record!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id));
1728-
1729-
let module_children = self.tcx.module_children_local(item.owner_id.def_id);
1730-
record_array!(self.tables.module_children_non_reexports[def_id] <-
1731-
module_children.iter().map(|child| child.res.def_id().index));
1732-
}
1733-
hir::ItemKind::TraitAlias(..) => {
1734-
record!(self.tables.trait_def[def_id] <- self.tcx.trait_def(def_id));
1735-
}
17361732
hir::ItemKind::ExternCrate(_)
17371733
| hir::ItemKind::Use(..)
1734+
| hir::ItemKind::Trait(..)
1735+
| hir::ItemKind::TraitAlias(..)
17381736
| hir::ItemKind::Static(..)
17391737
| hir::ItemKind::Const(..)
17401738
| hir::ItemKind::Enum(..)

0 commit comments

Comments
 (0)