@@ -838,7 +838,7 @@ enum DeclKind<'ra> {
838838 /// can be provided by source code or built into the language.
839839 Def ( Res ) ,
840840 /// The name declaration is a link to another name declaration.
841- Import { binding : Decl < ' ra > , import : Import < ' ra > } ,
841+ Import { source_decl : Decl < ' ra > , import : Import < ' ra > } ,
842842}
843843
844844impl < ' ra > DeclKind < ' ra > {
@@ -926,13 +926,13 @@ impl<'ra> DeclData<'ra> {
926926 fn res ( & self ) -> Res {
927927 match self . kind {
928928 DeclKind :: Def ( res) => res,
929- DeclKind :: Import { binding , .. } => binding . res ( ) ,
929+ DeclKind :: Import { source_decl , .. } => source_decl . res ( ) ,
930930 }
931931 }
932932
933933 fn import_source ( & self ) -> Decl < ' ra > {
934934 match self . kind {
935- DeclKind :: Import { binding , .. } => binding ,
935+ DeclKind :: Import { source_decl , .. } => source_decl ,
936936 _ => unreachable ! ( ) ,
937937 }
938938 }
@@ -941,7 +941,7 @@ impl<'ra> DeclData<'ra> {
941941 match self . ambiguity {
942942 Some ( ambig_binding) => Some ( ( self , ambig_binding) ) ,
943943 None => match self . kind {
944- DeclKind :: Import { binding , .. } => binding . descent_to_ambiguity ( ) ,
944+ DeclKind :: Import { source_decl , .. } => source_decl . descent_to_ambiguity ( ) ,
945945 _ => None ,
946946 } ,
947947 }
@@ -950,22 +950,22 @@ impl<'ra> DeclData<'ra> {
950950 fn is_ambiguity_recursive ( & self ) -> bool {
951951 self . ambiguity . is_some ( )
952952 || match self . kind {
953- DeclKind :: Import { binding , .. } => binding . is_ambiguity_recursive ( ) ,
953+ DeclKind :: Import { source_decl , .. } => source_decl . is_ambiguity_recursive ( ) ,
954954 _ => false ,
955955 }
956956 }
957957
958958 fn warn_ambiguity_recursive ( & self ) -> bool {
959959 self . warn_ambiguity
960960 || match self . kind {
961- DeclKind :: Import { binding , .. } => binding . warn_ambiguity_recursive ( ) ,
961+ DeclKind :: Import { source_decl , .. } => source_decl . warn_ambiguity_recursive ( ) ,
962962 _ => false ,
963963 }
964964 }
965965
966966 fn is_possibly_imported_variant ( & self ) -> bool {
967967 match self . kind {
968- DeclKind :: Import { binding , .. } => binding . is_possibly_imported_variant ( ) ,
968+ DeclKind :: Import { source_decl , .. } => source_decl . is_possibly_imported_variant ( ) ,
969969 DeclKind :: Def ( Res :: Def ( DefKind :: Variant | DefKind :: Ctor ( CtorOf :: Variant , ..) , _) ) => {
970970 true
971971 }
@@ -1012,9 +1012,9 @@ impl<'ra> DeclData<'ra> {
10121012 fn reexport_chain ( self : Decl < ' ra > , r : & Resolver < ' _ , ' _ > ) -> SmallVec < [ Reexport ; 2 ] > {
10131013 let mut reexport_chain = SmallVec :: new ( ) ;
10141014 let mut next_binding = self ;
1015- while let DeclKind :: Import { binding , import, .. } = next_binding. kind {
1015+ while let DeclKind :: Import { source_decl , import, .. } = next_binding. kind {
10161016 reexport_chain. push ( import. simplify ( r) ) ;
1017- next_binding = binding ;
1017+ next_binding = source_decl ;
10181018 }
10191019 reexport_chain
10201020 }
@@ -1043,9 +1043,9 @@ impl<'ra> DeclData<'ra> {
10431043 // FIXME: How can we integrate it with the `update_resolution`?
10441044 fn determined ( & self ) -> bool {
10451045 match & self . kind {
1046- DeclKind :: Import { binding , import, .. } if import. is_glob ( ) => {
1046+ DeclKind :: Import { source_decl , import, .. } if import. is_glob ( ) => {
10471047 import. parent_scope . module . unexpanded_invocations . borrow ( ) . is_empty ( )
1048- && binding . determined ( )
1048+ && source_decl . determined ( )
10491049 }
10501050 _ => true ,
10511051 }
@@ -1985,14 +1985,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
19851985 trait_name : Ident ,
19861986 ) -> SmallVec < [ LocalDefId ; 1 ] > {
19871987 let mut import_ids = smallvec ! [ ] ;
1988- while let DeclKind :: Import { import, binding , .. } = kind {
1988+ while let DeclKind :: Import { import, source_decl , .. } = kind {
19891989 if let Some ( node_id) = import. id ( ) {
19901990 let def_id = self . local_def_id ( node_id) ;
19911991 self . maybe_unused_trait_imports . insert ( def_id) ;
19921992 import_ids. push ( def_id) ;
19931993 }
19941994 self . add_to_glob_map ( * import, trait_name) ;
1995- kind = & binding . kind ;
1995+ kind = & source_decl . kind ;
19961996 }
19971997 import_ids
19981998 }
@@ -2066,7 +2066,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
20662066 self . ambiguity_errors . push ( ambiguity_error) ;
20672067 }
20682068 }
2069- if let DeclKind :: Import { import, binding } = used_decl. kind {
2069+ if let DeclKind :: Import { import, source_decl } = used_decl. kind {
20702070 if let ImportKind :: MacroUse { warn_private : true } = import. kind {
20712071 // Do not report the lint if the macro name resolves in stdlib prelude
20722072 // even without the problematic `macro_use` import.
@@ -2110,9 +2110,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
21102110 self . add_to_glob_map ( import, ident) ;
21112111 self . record_use_inner (
21122112 ident,
2113- binding ,
2113+ source_decl ,
21142114 Used :: Other ,
2115- warn_ambiguity || binding . warn_ambiguity ,
2115+ warn_ambiguity || source_decl . warn_ambiguity ,
21162116 ) ;
21172117 }
21182118 }
0 commit comments