@@ -351,7 +351,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
351
351
// Encountered a module item, abandon ribs and look into that module and preludes.
352
352
return self
353
353
. cm ( )
354
- . early_resolve_ident_in_lexical_scope (
354
+ . resolve_ident_in_scope_set (
355
355
orig_ident,
356
356
ScopeSet :: Late ( ns, module, finalize. map ( |finalize| finalize. node_id ) ) ,
357
357
parent_scope,
@@ -376,13 +376,9 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
376
376
unreachable ! ( )
377
377
}
378
378
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.
384
380
#[ 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 > (
386
382
self : CmResolver < ' r , ' ra , ' tcx > ,
387
383
orig_ident : Ident ,
388
384
scope_set : ScopeSet < ' ra > ,
@@ -811,7 +807,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
811
807
ModuleOrUniformRoot :: Module ( module) => module,
812
808
ModuleOrUniformRoot :: ModuleAndExternPrelude ( module) => {
813
809
assert_eq ! ( shadowing, Shadowing :: Unrestricted ) ;
814
- let binding = self . early_resolve_ident_in_lexical_scope (
810
+ let binding = self . resolve_ident_in_scope_set (
815
811
ident,
816
812
ScopeSet :: ModuleAndExternPrelude ( ns, module) ,
817
813
parent_scope,
@@ -827,7 +823,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
827
823
return if ns != TypeNS {
828
824
Err ( ( Determined , Weak :: No ) )
829
825
} else {
830
- let binding = self . early_resolve_ident_in_lexical_scope (
826
+ let binding = self . resolve_ident_in_scope_set (
831
827
ident,
832
828
ScopeSet :: ExternPrelude ,
833
829
parent_scope,
@@ -852,7 +848,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
852
848
}
853
849
}
854
850
855
- let binding = self . early_resolve_ident_in_lexical_scope (
851
+ let binding = self . resolve_ident_in_scope_set (
856
852
ident,
857
853
ScopeSet :: All ( ns) ,
858
854
parent_scope,
@@ -945,7 +941,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
945
941
// Now we are in situation when new item/import can appear only from a glob or a macro
946
942
// expansion. With restricted shadowing names from globs and macro expansions cannot
947
943
// 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
949
945
// scopes we return `Undetermined` with `Weak::Yes`.
950
946
951
947
// Check if one of unexpanded macros can still define the name,
@@ -1635,7 +1631,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1635
1631
_ => Err ( Determinacy :: determined ( finalize. is_some ( ) ) ) ,
1636
1632
}
1637
1633
} else {
1638
- self . reborrow ( ) . early_resolve_ident_in_lexical_scope (
1634
+ self . reborrow ( ) . resolve_ident_in_scope_set (
1639
1635
ident,
1640
1636
ScopeSet :: All ( ns) ,
1641
1637
parent_scope,
0 commit comments