@@ -5,8 +5,9 @@ use crate::rmeta::*;
5
5
6
6
use rustc:: dep_graph:: { self , DepNodeIndex } ;
7
7
use rustc:: hir;
8
- use rustc:: hir:: def:: { self , CtorKind , CtorOf , DefKind , Res } ;
8
+ use rustc:: hir:: def:: { CtorKind , CtorOf , DefKind , Res } ;
9
9
use rustc:: hir:: def_id:: { CrateNum , DefId , DefIndex , LocalDefId , CRATE_DEF_INDEX , LOCAL_CRATE } ;
10
+ use rustc:: hir:: exports:: Export ;
10
11
use rustc:: hir:: map:: definitions:: DefPathTable ;
11
12
use rustc:: hir:: map:: { DefKey , DefPath , DefPathData , DefPathHash } ;
12
13
use rustc:: middle:: cstore:: { CrateSource , ExternCrate } ;
@@ -930,7 +931,7 @@ impl<'a, 'tcx> CrateMetadata {
930
931
/// Iterates over each child of the given item.
931
932
fn each_child_of_item < F > ( & self , id : DefIndex , mut callback : F , sess : & Session )
932
933
where
933
- F : FnMut ( def :: Export < hir:: HirId > ) ,
934
+ F : FnMut ( Export < hir:: HirId > ) ,
934
935
{
935
936
if let Some ( proc_macros_ids) = self . root . proc_macro_data . map ( |d| d. decode ( self ) ) {
936
937
/* 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 {
944
945
self . local_def_id ( def_index) ,
945
946
) ;
946
947
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 } ) ;
953
949
}
954
950
}
955
951
return ;
@@ -989,7 +985,7 @@ impl<'a, 'tcx> CrateMetadata {
989
985
. unwrap_or ( Lazy :: empty ( ) ) ;
990
986
for child_index in child_children. decode ( ( self , sess) ) {
991
987
if let Some ( kind) = self . def_kind ( child_index) {
992
- callback ( def :: Export {
988
+ callback ( Export {
993
989
res : Res :: Def ( kind, self . local_def_id ( child_index) ) ,
994
990
ident : Ident :: with_dummy_span ( self . item_name ( child_index) ) ,
995
991
vis : self . get_visibility ( child_index) ,
@@ -1019,7 +1015,7 @@ impl<'a, 'tcx> CrateMetadata {
1019
1015
let vis = self . get_visibility ( child_index) ;
1020
1016
let def_id = self . local_def_id ( child_index) ;
1021
1017
let res = Res :: Def ( kind, def_id) ;
1022
- callback ( def :: Export { res, ident, vis, span } ) ;
1018
+ callback ( Export { res, ident, vis, span } ) ;
1023
1019
// For non-re-export structs and variants add their constructors to children.
1024
1020
// Re-export lists automatically contain constructors when necessary.
1025
1021
match kind {
@@ -1029,7 +1025,7 @@ impl<'a, 'tcx> CrateMetadata {
1029
1025
let ctor_res =
1030
1026
Res :: Def ( DefKind :: Ctor ( CtorOf :: Struct , ctor_kind) , ctor_def_id) ;
1031
1027
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 } ) ;
1033
1029
}
1034
1030
}
1035
1031
DefKind :: Variant => {
@@ -1053,7 +1049,7 @@ impl<'a, 'tcx> CrateMetadata {
1053
1049
vis = ty:: Visibility :: Restricted ( crate_def_id) ;
1054
1050
}
1055
1051
}
1056
- callback ( def :: Export { res : ctor_res, ident, vis, span } ) ;
1052
+ callback ( Export { res : ctor_res, ident, vis, span } ) ;
1057
1053
}
1058
1054
_ => { }
1059
1055
}
0 commit comments