@@ -349,6 +349,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
349
349
ident,
350
350
ns,
351
351
parent_scope,
352
+ false ,
352
353
finalize. map ( |finalize| Finalize { used : Used :: Scope , ..finalize } ) ,
353
354
ignore_binding,
354
355
None ,
@@ -493,7 +494,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
493
494
Scope :: CrateRoot => {
494
495
let root_ident = Ident :: new ( kw:: PathRoot , ident. span ) ;
495
496
let root_module = this. resolve_crate_root ( root_ident) ;
496
- let binding = this. resolve_ident_in_module_ext (
497
+ let binding = this. resolve_ident_in_module (
497
498
ModuleOrUniformRoot :: Module ( root_module) ,
498
499
ident,
499
500
ns,
@@ -515,7 +516,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
515
516
}
516
517
Scope :: Module ( module, derive_fallback_lint_id) => {
517
518
let adjusted_parent_scope = & ParentScope { module, ..* parent_scope } ;
518
- let binding = this. resolve_ident_in_module_unadjusted_ext (
519
+ let binding = this. resolve_ident_in_module_unadjusted (
519
520
ModuleOrUniformRoot :: Module ( module) ,
520
521
ident,
521
522
ns,
@@ -589,6 +590,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
589
590
ident,
590
591
ns,
591
592
parent_scope,
593
+ false ,
592
594
None ,
593
595
ignore_binding,
594
596
ignore_import,
@@ -747,35 +749,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
747
749
parent_scope : & ParentScope < ' ra > ,
748
750
ignore_import : Option < Import < ' ra > > ,
749
751
) -> Result < NameBinding < ' ra > , Determinacy > {
750
- self . resolve_ident_in_module_ext ( module, ident, ns, parent_scope, None , None , ignore_import)
752
+ self . resolve_ident_in_module ( module, ident, ns, parent_scope, None , None , ignore_import)
751
753
. map_err ( |( determinacy, _) | determinacy)
752
754
}
753
755
754
756
#[ instrument( level = "debug" , skip( self ) ) ]
755
757
pub ( crate ) fn resolve_ident_in_module (
756
- & mut self ,
757
- module : ModuleOrUniformRoot < ' ra > ,
758
- ident : Ident ,
759
- ns : Namespace ,
760
- parent_scope : & ParentScope < ' ra > ,
761
- finalize : Option < Finalize > ,
762
- ignore_binding : Option < NameBinding < ' ra > > ,
763
- ignore_import : Option < Import < ' ra > > ,
764
- ) -> Result < NameBinding < ' ra > , Determinacy > {
765
- self . resolve_ident_in_module_ext (
766
- module,
767
- ident,
768
- ns,
769
- parent_scope,
770
- finalize,
771
- ignore_binding,
772
- ignore_import,
773
- )
774
- . map_err ( |( determinacy, _) | determinacy)
775
- }
776
-
777
- #[ instrument( level = "debug" , skip( self ) ) ]
778
- fn resolve_ident_in_module_ext (
779
758
& mut self ,
780
759
module : ModuleOrUniformRoot < ' ra > ,
781
760
mut ident : Ident ,
@@ -802,7 +781,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
802
781
// No adjustments
803
782
}
804
783
}
805
- self . resolve_ident_in_module_unadjusted_ext (
784
+ self . resolve_ident_in_module_unadjusted (
806
785
module,
807
786
ident,
808
787
ns,
@@ -814,34 +793,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
814
793
)
815
794
}
816
795
817
- #[ instrument( level = "debug" , skip( self ) ) ]
818
- fn resolve_ident_in_module_unadjusted (
819
- & mut self ,
820
- module : ModuleOrUniformRoot < ' ra > ,
821
- ident : Ident ,
822
- ns : Namespace ,
823
- parent_scope : & ParentScope < ' ra > ,
824
- finalize : Option < Finalize > ,
825
- ignore_binding : Option < NameBinding < ' ra > > ,
826
- ignore_import : Option < Import < ' ra > > ,
827
- ) -> Result < NameBinding < ' ra > , Determinacy > {
828
- self . resolve_ident_in_module_unadjusted_ext (
829
- module,
830
- ident,
831
- ns,
832
- parent_scope,
833
- false ,
834
- finalize,
835
- ignore_binding,
836
- ignore_import,
837
- )
838
- . map_err ( |( determinacy, _) | determinacy)
839
- }
840
-
841
796
/// Attempts to resolve `ident` in namespaces `ns` of `module`.
842
797
/// Invariant: if `finalize` is `Some`, expansion and import resolution must be complete.
843
798
#[ instrument( level = "debug" , skip( self ) ) ]
844
- fn resolve_ident_in_module_unadjusted_ext (
799
+ fn resolve_ident_in_module_unadjusted (
845
800
& mut self ,
846
801
module : ModuleOrUniformRoot < ' ra > ,
847
802
ident : Ident ,
@@ -1046,13 +1001,13 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1046
1001
ignore_binding,
1047
1002
ignore_import,
1048
1003
) {
1049
- Err ( Determined ) => continue ,
1004
+ Err ( ( Determined , _ ) ) => continue ,
1050
1005
Ok ( binding)
1051
1006
if !self . is_accessible_from ( binding. vis , single_import. parent_scope . module ) =>
1052
1007
{
1053
1008
continue ;
1054
1009
}
1055
- Ok ( _) | Err ( Undetermined ) => return Err ( ( Undetermined , Weak :: No ) ) ,
1010
+ Ok ( _) | Err ( ( Undetermined , _ ) ) => return Err ( ( Undetermined , Weak :: No ) ) ,
1056
1011
}
1057
1012
}
1058
1013
@@ -1121,19 +1076,20 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1121
1076
ident,
1122
1077
ns,
1123
1078
adjusted_parent_scope,
1079
+ false ,
1124
1080
None ,
1125
1081
ignore_binding,
1126
1082
ignore_import,
1127
1083
) ;
1128
1084
1129
1085
match result {
1130
- Err ( Determined ) => continue ,
1086
+ Err ( ( Determined , _ ) ) => continue ,
1131
1087
Ok ( binding)
1132
1088
if !self . is_accessible_from ( binding. vis , glob_import. parent_scope . module ) =>
1133
1089
{
1134
1090
continue ;
1135
1091
}
1136
- Ok ( _) | Err ( Undetermined ) => return Err ( ( Undetermined , Weak :: Yes ) ) ,
1092
+ Ok ( _) | Err ( ( Undetermined , _ ) ) => return Err ( ( Undetermined , Weak :: Yes ) ) ,
1137
1093
}
1138
1094
}
1139
1095
@@ -1564,6 +1520,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1564
1520
ignore_binding,
1565
1521
ignore_import,
1566
1522
)
1523
+ . map_err ( |( determinacy, _) | determinacy)
1567
1524
} else if let Some ( ribs) = ribs
1568
1525
&& let Some ( TypeNS | ValueNS ) = opt_ns
1569
1526
{
0 commit comments