@@ -680,20 +680,19 @@ impl ItemScope {
680680 changed = true ;
681681 }
682682 Entry :: Occupied ( mut entry)
683- if !matches ! ( import, Some ( ImportOrExternCrate :: Glob ( ..) ) ) =>
683+ if !matches ! ( import, Some ( ImportOrExternCrate :: Glob ( ..) ) )
684+ && glob_imports. values . remove ( & lookup) =>
684685 {
685- if glob_imports. values . remove ( & lookup) {
686- cov_mark:: hit!( import_shadowed) ;
687-
688- let import = import. and_then ( ImportOrExternCrate :: import_or_glob) ;
689- let prev = std:: mem:: replace ( & mut fld. import , import) ;
690- if let Some ( import) = import {
691- self . use_imports_values
692- . insert ( import, prev. map_or ( ImportOrDef :: Def ( fld. def ) , Into :: into) ) ;
693- }
694- entry. insert ( fld) ;
695- changed = true ;
686+ cov_mark:: hit!( import_shadowed) ;
687+
688+ let import = import. and_then ( ImportOrExternCrate :: import_or_glob) ;
689+ let prev = std:: mem:: replace ( & mut fld. import , import) ;
690+ if let Some ( import) = import {
691+ self . use_imports_values
692+ . insert ( import, prev. map_or ( ImportOrDef :: Def ( fld. def ) , Into :: into) ) ;
696693 }
694+ entry. insert ( fld) ;
695+ changed = true ;
697696 }
698697 _ => { }
699698 }
@@ -720,20 +719,19 @@ impl ItemScope {
720719 changed = true ;
721720 }
722721 Entry :: Occupied ( mut entry)
723- if !matches ! ( import, Some ( ImportOrExternCrate :: Glob ( ..) ) ) =>
722+ if !matches ! ( import, Some ( ImportOrExternCrate :: Glob ( ..) ) )
723+ && glob_imports. macros . remove ( & lookup) =>
724724 {
725- if glob_imports. macros . remove ( & lookup) {
726- cov_mark:: hit!( import_shadowed) ;
727- let prev = std:: mem:: replace ( & mut fld. import , import) ;
728- if let Some ( import) = import {
729- self . use_imports_macros . insert (
730- import,
731- prev. map_or_else ( || ImportOrDef :: Def ( fld. def . into ( ) ) , Into :: into) ,
732- ) ;
733- }
734- entry. insert ( fld) ;
735- changed = true ;
725+ cov_mark:: hit!( import_shadowed) ;
726+ let prev = std:: mem:: replace ( & mut fld. import , import) ;
727+ if let Some ( import) = import {
728+ self . use_imports_macros . insert (
729+ import,
730+ prev. map_or_else ( || ImportOrDef :: Def ( fld. def . into ( ) ) , Into :: into) ,
731+ ) ;
736732 }
733+ entry. insert ( fld) ;
734+ changed = true ;
737735 }
738736 _ => { }
739737 }
0 commit comments