@@ -1901,12 +1901,13 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
1901
1901
}
1902
1902
1903
1903
ident. span = ident. span . modern ( ) ;
1904
+ let mut poisoned = None ;
1904
1905
loop {
1905
- let ( opt_module, poisoned ) = if let Some ( node_id) = record_used_id {
1906
+ let opt_module = if let Some ( node_id) = record_used_id {
1906
1907
self . hygienic_lexical_parent_with_compatibility_fallback ( module, & mut ident. span ,
1907
- node_id)
1908
+ node_id, & mut poisoned )
1908
1909
} else {
1909
- ( self . hygienic_lexical_parent ( module, & mut ident. span ) , None )
1910
+ self . hygienic_lexical_parent ( module, & mut ident. span )
1910
1911
} ;
1911
1912
module = unwrap_or ! ( opt_module, break ) ;
1912
1913
let orig_current_module = self . current_module ;
@@ -1934,7 +1935,6 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
1934
1935
}
1935
1936
return Some ( LexicalScopeBinding :: Item ( binding) )
1936
1937
}
1937
- _ if poisoned. is_some ( ) => break ,
1938
1938
Err ( Determined ) => continue ,
1939
1939
Err ( Undetermined ) =>
1940
1940
span_bug ! ( ident. span, "undetermined resolution during main resolution pass" ) ,
@@ -1994,12 +1994,12 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
1994
1994
None
1995
1995
}
1996
1996
1997
- fn hygienic_lexical_parent_with_compatibility_fallback (
1998
- & mut self , module : Module < ' a > , span : & mut Span , node_id : NodeId
1999
- ) -> ( Option < Module < ' a > > , /* poisoned */ Option < NodeId > )
2000
- {
1997
+ fn hygienic_lexical_parent_with_compatibility_fallback ( & mut self , module : Module < ' a > ,
1998
+ span : & mut Span , node_id : NodeId ,
1999
+ poisoned : & mut Option < NodeId > )
2000
+ -> Option < Module < ' a > > {
2001
2001
if let module @ Some ( ..) = self . hygienic_lexical_parent ( module, span) {
2002
- return ( module, None ) ;
2002
+ return module;
2003
2003
}
2004
2004
2005
2005
// We need to support the next case under a deprecation warning
@@ -2020,13 +2020,14 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
2020
2020
// The macro is a proc macro derive
2021
2021
if module. expansion . looks_like_proc_macro_derive ( ) {
2022
2022
if parent. expansion . is_descendant_of ( span. ctxt ( ) . outer ( ) ) {
2023
- return ( module. parent , Some ( node_id) ) ;
2023
+ * poisoned = Some ( node_id) ;
2024
+ return module. parent ;
2024
2025
}
2025
2026
}
2026
2027
}
2027
2028
}
2028
2029
2029
- ( None , None )
2030
+ None
2030
2031
}
2031
2032
2032
2033
fn resolve_ident_in_module ( & mut self ,
0 commit comments