@@ -283,11 +283,6 @@ enum UseLexicalScopeFlag {
283
283
UseLexicalScope
284
284
}
285
285
286
- enum SearchThroughModulesFlag {
287
- DontSearchThroughModules ,
288
- SearchThroughModules
289
- }
290
-
291
286
enum ModulePrefixResult {
292
287
NoPrefixFound ,
293
288
PrefixFound ( Rc < Module > , uint )
@@ -2849,9 +2844,7 @@ impl<'a> Resolver<'a> {
2849
2844
fn resolve_item_in_lexical_scope ( & mut self ,
2850
2845
module_ : Rc < Module > ,
2851
2846
name : Ident ,
2852
- namespace : Namespace ,
2853
- search_through_modules :
2854
- SearchThroughModulesFlag )
2847
+ namespace : Namespace )
2855
2848
-> ResolveResult < ( Target , bool ) > {
2856
2849
debug ! ( "(resolving item in lexical scope) resolving `{}` in \
2857
2850
namespace {:?} in `{}`",
@@ -2924,26 +2917,19 @@ impl<'a> Resolver<'a> {
2924
2917
return Failed ;
2925
2918
}
2926
2919
ModuleParentLink ( parent_module_node, _) => {
2927
- match search_through_modules {
2928
- DontSearchThroughModules => {
2929
- match search_module. kind . get ( ) {
2930
- NormalModuleKind => {
2931
- // We stop the search here.
2932
- debug ! ( "(resolving item in lexical \
2933
- scope) unresolved module: not \
2934
- searching through module \
2935
- parents") ;
2936
- return Failed ;
2937
- }
2938
- ExternModuleKind |
2939
- TraitModuleKind |
2940
- ImplModuleKind |
2941
- AnonymousModuleKind => {
2942
- search_module = parent_module_node. upgrade ( ) . unwrap ( ) ;
2943
- }
2944
- }
2920
+ match search_module. kind . get ( ) {
2921
+ NormalModuleKind => {
2922
+ // We stop the search here.
2923
+ debug ! ( "(resolving item in lexical \
2924
+ scope) unresolved module: not \
2925
+ searching through module \
2926
+ parents") ;
2927
+ return Failed ;
2945
2928
}
2946
- SearchThroughModules => {
2929
+ ExternModuleKind |
2930
+ TraitModuleKind |
2931
+ ImplModuleKind |
2932
+ AnonymousModuleKind => {
2947
2933
search_module = parent_module_node. upgrade ( ) . unwrap ( ) ;
2948
2934
}
2949
2935
}
@@ -2988,7 +2974,7 @@ impl<'a> Resolver<'a> {
2988
2974
// If this module is an anonymous module, resolve the item in the
2989
2975
// lexical scope. Otherwise, resolve the item from the crate root.
2990
2976
let resolve_result = self . resolve_item_in_lexical_scope (
2991
- module_, name, TypeNS , DontSearchThroughModules ) ;
2977
+ module_, name, TypeNS ) ;
2992
2978
match resolve_result {
2993
2979
Success ( ( target, _) ) => {
2994
2980
let bindings = & * target. bindings ;
@@ -4517,8 +4503,7 @@ impl<'a> Resolver<'a> {
4517
4503
let module = self . current_module . clone ( ) ;
4518
4504
match self . resolve_item_in_lexical_scope ( module,
4519
4505
name,
4520
- ValueNS ,
4521
- SearchThroughModules ) {
4506
+ ValueNS ) {
4522
4507
Success ( ( target, _) ) => {
4523
4508
debug ! ( "(resolve bare identifier pattern) succeeded in \
4524
4509
finding {} at {:?}",
@@ -4859,8 +4844,7 @@ impl<'a> Resolver<'a> {
4859
4844
let module = self . current_module . clone ( ) ;
4860
4845
match self . resolve_item_in_lexical_scope ( module,
4861
4846
ident,
4862
- namespace,
4863
- DontSearchThroughModules ) {
4847
+ namespace) {
4864
4848
Success ( ( target, _) ) => {
4865
4849
match ( * target. bindings ) . def_for_namespace ( namespace) {
4866
4850
None => {
0 commit comments