@@ -5,8 +5,9 @@ use crate::rmeta::*;
55
66use rustc:: dep_graph:: { self , DepNodeIndex } ;
77use rustc:: hir;
8- use rustc:: hir:: def:: { self , CtorKind , CtorOf , DefKind , Res } ;
8+ use rustc:: hir:: def:: { CtorKind , CtorOf , DefKind , Res } ;
99use rustc:: hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , CRATE_DEF_INDEX , LOCAL_CRATE } ;
10+ use rustc:: hir:: exports:: Export ;
1011use rustc:: hir:: map:: definitions:: DefPathTable ;
1112use rustc:: hir:: map:: { DefKey , DefPath , DefPathData , DefPathHash } ;
1213use rustc:: middle:: cstore:: { CrateSource , ExternCrate } ;
@@ -930,7 +931,7 @@ impl<'a, 'tcx> CrateMetadata {
930931 /// Iterates over each child of the given item.
931932 fn each_child_of_item < F > ( & self , id : DefIndex , mut callback : F , sess : & Session )
932933 where
933- F : FnMut ( def :: Export < hir:: HirId > ) ,
934+ F : FnMut ( Export < hir:: HirId > ) ,
934935 {
935936 if let Some ( proc_macros_ids) = self . root . proc_macro_data . map ( |d| d. decode ( self ) ) {
936937 /* If we are loading as a proc macro, we want to return the view of this crate
@@ -944,12 +945,7 @@ impl<'a, 'tcx> CrateMetadata {
944945 self . local_def_id ( def_index) ,
945946 ) ;
946947 let ident = Ident :: from_str ( raw_macro. name ( ) ) ;
947- callback ( def:: Export {
948- ident : ident,
949- res : res,
950- vis : ty:: Visibility :: Public ,
951- span : DUMMY_SP ,
952- } ) ;
948+ callback ( Export { ident, res, vis : ty:: Visibility :: Public , span : DUMMY_SP } ) ;
953949 }
954950 }
955951 return ;
@@ -989,7 +985,7 @@ impl<'a, 'tcx> CrateMetadata {
989985 . unwrap_or ( Lazy :: empty ( ) ) ;
990986 for child_index in child_children. decode ( ( self , sess) ) {
991987 if let Some ( kind) = self . def_kind ( child_index) {
992- callback ( def :: Export {
988+ callback ( Export {
993989 res : Res :: Def ( kind, self . local_def_id ( child_index) ) ,
994990 ident : Ident :: with_dummy_span ( self . item_name ( child_index) ) ,
995991 vis : self . get_visibility ( child_index) ,
@@ -1019,7 +1015,7 @@ impl<'a, 'tcx> CrateMetadata {
10191015 let vis = self . get_visibility ( child_index) ;
10201016 let def_id = self . local_def_id ( child_index) ;
10211017 let res = Res :: Def ( kind, def_id) ;
1022- callback ( def :: Export { res, ident, vis, span } ) ;
1018+ callback ( Export { res, ident, vis, span } ) ;
10231019 // For non-re-export structs and variants add their constructors to children.
10241020 // Re-export lists automatically contain constructors when necessary.
10251021 match kind {
@@ -1029,7 +1025,7 @@ impl<'a, 'tcx> CrateMetadata {
10291025 let ctor_res =
10301026 Res :: Def ( DefKind :: Ctor ( CtorOf :: Struct , ctor_kind) , ctor_def_id) ;
10311027 let vis = self . get_visibility ( ctor_def_id. index ) ;
1032- callback ( def :: Export { res : ctor_res, vis, ident, span } ) ;
1028+ callback ( Export { res : ctor_res, vis, ident, span } ) ;
10331029 }
10341030 }
10351031 DefKind :: Variant => {
@@ -1053,7 +1049,7 @@ impl<'a, 'tcx> CrateMetadata {
10531049 vis = ty:: Visibility :: Restricted ( crate_def_id) ;
10541050 }
10551051 }
1056- callback ( def :: Export { res : ctor_res, ident, vis, span } ) ;
1052+ callback ( Export { res : ctor_res, ident, vis, span } ) ;
10571053 }
10581054 _ => { }
10591055 }
0 commit comments