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