@@ -758,17 +758,14 @@ impl<'a> Resolver<'a> {
758
758
{
759
759
let mut candidates = Vec :: new ( ) ;
760
760
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 ) ] ;
764
762
let mut worklist_via_import = vec ! [ ] ;
765
763
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 ( ) ;
772
769
// We have to visit module children in deterministic order to avoid
773
770
// instabilities in reported imports (#43552).
774
771
in_module. for_each_child ( self , |this, ident, ns, name_binding| {
@@ -850,11 +847,10 @@ impl<'a> Resolver<'a> {
850
847
name_binding. is_extern_crate ( ) && lookup_ident. span . rust_2018 ( ) ;
851
848
852
849
if !is_extern_crate_that_also_appears_in_prelude {
853
- let is_extern = in_module_is_extern || name_binding. is_extern_crate ( ) ;
854
850
// add the module to the lookup
855
851
if seen_modules. insert ( module. def_id ( ) . unwrap ( ) ) {
856
852
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) ) ;
858
854
}
859
855
}
860
856
}
0 commit comments