@@ -351,7 +351,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
351351 // Encountered a module item, abandon ribs and look into that module and preludes.
352352 return self
353353 . cm ( )
354- . early_resolve_ident_in_lexical_scope (
354+ . resolve_ident_in_scope_set (
355355 orig_ident,
356356 ScopeSet :: Late ( ns, module, finalize. map ( |finalize| finalize. node_id ) ) ,
357357 parent_scope,
@@ -376,13 +376,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
376376 unreachable ! ( )
377377 }
378378
379- /// Resolve an identifier in lexical scope.
380- /// This is a variation of `fn resolve_ident_in_lexical_scope` that can be run during
381- /// expansion and import resolution (perhaps they can be merged in the future).
382- /// The function is used for resolving initial segments of macro paths (e.g., `foo` in
383- /// `foo::bar!();` or `foo!();`) and also for import paths on 2018 edition.
379+ /// Resolve an identifier in the specified set of scopes.
384380 #[ instrument( level = "debug" , skip( self ) ) ]
385- pub ( crate ) fn early_resolve_ident_in_lexical_scope < ' r > (
381+ pub ( crate ) fn resolve_ident_in_scope_set < ' r > (
386382 self : CmResolver < ' r , ' ra , ' tcx > ,
387383 orig_ident : Ident ,
388384 scope_set : ScopeSet < ' ra > ,
@@ -811,7 +807,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
811807 ModuleOrUniformRoot :: Module ( module) => module,
812808 ModuleOrUniformRoot :: ModuleAndExternPrelude ( module) => {
813809 assert_eq ! ( shadowing, Shadowing :: Unrestricted ) ;
814- let binding = self . early_resolve_ident_in_lexical_scope (
810+ let binding = self . resolve_ident_in_scope_set (
815811 ident,
816812 ScopeSet :: ModuleAndExternPrelude ( ns, module) ,
817813 parent_scope,
@@ -827,7 +823,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
827823 return if ns != TypeNS {
828824 Err ( ( Determined , Weak :: No ) )
829825 } else {
830- let binding = self . early_resolve_ident_in_lexical_scope (
826+ let binding = self . resolve_ident_in_scope_set (
831827 ident,
832828 ScopeSet :: ExternPrelude ,
833829 parent_scope,
@@ -852,7 +848,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
852848 }
853849 }
854850
855- let binding = self . early_resolve_ident_in_lexical_scope (
851+ let binding = self . resolve_ident_in_scope_set (
856852 ident,
857853 ScopeSet :: All ( ns) ,
858854 parent_scope,
@@ -945,7 +941,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
945941 // Now we are in situation when new item/import can appear only from a glob or a macro
946942 // expansion. With restricted shadowing names from globs and macro expansions cannot
947943 // shadow names from outer scopes, so we can freely fallback from module search to search
948- // in outer scopes. For `early_resolve_ident_in_lexical_scope ` to continue search in outer
944+ // in outer scopes. For `resolve_ident_in_scope_set ` to continue search in outer
949945 // scopes we return `Undetermined` with `Weak::Yes`.
950946
951947 // Check if one of unexpanded macros can still define the name,
@@ -1635,7 +1631,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
16351631 _ => Err ( Determinacy :: determined ( finalize. is_some ( ) ) ) ,
16361632 }
16371633 } else {
1638- self . reborrow ( ) . early_resolve_ident_in_lexical_scope (
1634+ self . reborrow ( ) . resolve_ident_in_scope_set (
16391635 ident,
16401636 ScopeSet :: All ( ns) ,
16411637 parent_scope,
0 commit comments