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