@@ -758,17 +758,14 @@ impl<'a> Resolver<'a> {
758758 {
759759 let mut candidates = Vec :: new ( ) ;
760760 let mut seen_modules = FxHashSet :: default ( ) ;
761- let not_local_module = crate_name. name != kw:: Crate ;
762- let mut worklist =
763- vec ! [ ( start_module, Vec :: <ast:: PathSegment >:: new( ) , true , not_local_module) ] ;
761+ let mut worklist = vec ! [ ( start_module, Vec :: <ast:: PathSegment >:: new( ) , true ) ] ;
764762 let mut worklist_via_import = vec ! [ ] ;
765763
766- while let Some ( ( in_module, path_segments, accessible, in_module_is_extern) ) =
767- match worklist. pop ( ) {
768- None => worklist_via_import. pop ( ) ,
769- Some ( x) => Some ( x) ,
770- }
771- {
764+ while let Some ( ( in_module, path_segments, accessible) ) = match worklist. pop ( ) {
765+ None => worklist_via_import. pop ( ) ,
766+ Some ( x) => Some ( x) ,
767+ } {
768+ let in_module_is_extern = !in_module. def_id ( ) . unwrap ( ) . is_local ( ) ;
772769 // We have to visit module children in deterministic order to avoid
773770 // instabilities in reported imports (#43552).
774771 in_module. for_each_child ( self , |this, ident, ns, name_binding| {
@@ -850,11 +847,10 @@ impl<'a> Resolver<'a> {
850847 name_binding. is_extern_crate ( ) && lookup_ident. span . rust_2018 ( ) ;
851848
852849 if !is_extern_crate_that_also_appears_in_prelude {
853- let is_extern = in_module_is_extern || name_binding. is_extern_crate ( ) ;
854850 // add the module to the lookup
855851 if seen_modules. insert ( module. def_id ( ) . unwrap ( ) ) {
856852 if via_import { & mut worklist_via_import } else { & mut worklist }
857- . push ( ( module, path_segments, child_accessible, is_extern ) ) ;
853+ . push ( ( module, path_segments, child_accessible) ) ;
858854 }
859855 }
860856 }
0 commit comments