@@ -867,7 +867,8 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
867
867
let expansion = ExpnId :: root ( ) ; // FIXME(jseyfried) intercrate hygiene
868
868
match res {
869
869
Res :: Def ( kind @ DefKind :: Mod , def_id)
870
- | Res :: Def ( kind @ DefKind :: Enum , def_id) => {
870
+ | Res :: Def ( kind @ DefKind :: Enum , def_id)
871
+ | Res :: Def ( kind @ DefKind :: Trait , def_id) => {
871
872
let module = self . r . new_module ( parent,
872
873
ModuleKind :: Def ( kind, def_id, ident. name ) ,
873
874
def_id,
@@ -880,13 +881,16 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
880
881
| Res :: Def ( DefKind :: ForeignTy , _)
881
882
| Res :: Def ( DefKind :: OpaqueTy , _)
882
883
| Res :: Def ( DefKind :: TraitAlias , _)
884
+ | Res :: Def ( DefKind :: AssocTy , _)
885
+ | Res :: Def ( DefKind :: AssocOpaqueTy , _)
883
886
| Res :: PrimTy ( ..)
884
887
| Res :: ToolMod => {
885
888
self . r . define ( parent, ident, TypeNS , ( res, vis, DUMMY_SP , expansion) ) ;
886
889
}
887
890
Res :: Def ( DefKind :: Fn , _)
888
891
| Res :: Def ( DefKind :: Static , _)
889
892
| Res :: Def ( DefKind :: Const , _)
893
+ | Res :: Def ( DefKind :: AssocConst , _)
890
894
| Res :: Def ( DefKind :: Ctor ( CtorOf :: Variant , ..) , _) => {
891
895
self . r . define ( parent, ident, ValueNS , ( res, vis, DUMMY_SP , expansion) ) ;
892
896
}
@@ -899,28 +903,11 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
899
903
self . r . struct_constructors . insert ( struct_def_id, ( res, vis) ) ;
900
904
}
901
905
}
902
- Res :: Def ( DefKind :: Trait , def_id) => {
903
- let module_kind = ModuleKind :: Def ( DefKind :: Trait , def_id, ident. name ) ;
904
- let module = self . r . new_module ( parent,
905
- module_kind,
906
- parent. normal_ancestor_id ,
907
- expansion,
908
- span) ;
909
- self . r . define ( parent, ident, TypeNS , ( module, vis, DUMMY_SP , expansion) ) ;
906
+ Res :: Def ( DefKind :: Method , def_id) => {
907
+ self . r . define ( parent, ident, ValueNS , ( res, vis, DUMMY_SP , expansion) ) ;
910
908
911
- module. populate_on_access . set ( false ) ;
912
- for child in self . r . cstore . item_children_untracked ( def_id, self . r . session ) {
913
- let res = child. res . map_id ( |_| panic ! ( "unexpected id" ) ) ;
914
- let ns = if let Res :: Def ( DefKind :: AssocTy , _) = res {
915
- TypeNS
916
- } else { ValueNS } ;
917
- self . r . define ( module, child. ident , ns,
918
- ( res, ty:: Visibility :: Public , DUMMY_SP , expansion) ) ;
919
-
920
- if self . r . cstore . associated_item_cloned_untracked ( child. res . def_id ( ) )
921
- . method_has_self_argument {
922
- self . r . has_self . insert ( res. def_id ( ) ) ;
923
- }
909
+ if self . r . cstore . associated_item_cloned_untracked ( def_id) . method_has_self_argument {
910
+ self . r . has_self . insert ( def_id) ;
924
911
}
925
912
}
926
913
Res :: Def ( DefKind :: Struct , def_id) | Res :: Def ( DefKind :: Union , def_id) => {
0 commit comments