@@ -1900,12 +1900,13 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
19001900 }
19011901
19021902 ident. span = ident. span . modern ( ) ;
1903+ let mut poisoned = None ;
19031904 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 {
19051906 self . hygienic_lexical_parent_with_compatibility_fallback ( module, & mut ident. span ,
1906- node_id)
1907+ node_id, & mut poisoned )
19071908 } else {
1908- ( self . hygienic_lexical_parent ( module, & mut ident. span ) , None )
1909+ self . hygienic_lexical_parent ( module, & mut ident. span )
19091910 } ;
19101911 module = unwrap_or ! ( opt_module, break ) ;
19111912 let orig_current_module = self . current_module ;
@@ -1933,7 +1934,6 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
19331934 }
19341935 return Some ( LexicalScopeBinding :: Item ( binding) )
19351936 }
1936- _ if poisoned. is_some ( ) => break ,
19371937 Err ( Determined ) => continue ,
19381938 Err ( Undetermined ) =>
19391939 span_bug ! ( ident. span, "undetermined resolution during main resolution pass" ) ,
@@ -1993,12 +1993,12 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
19931993 None
19941994 }
19951995
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 > > {
20002000 if let module @ Some ( ..) = self . hygienic_lexical_parent ( module, span) {
2001- return ( module, None ) ;
2001+ return module;
20022002 }
20032003
20042004 // We need to support the next case under a deprecation warning
@@ -2019,13 +2019,14 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
20192019 // The macro is a proc macro derive
20202020 if module. expansion . looks_like_proc_macro_derive ( ) {
20212021 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 ;
20232024 }
20242025 }
20252026 }
20262027 }
20272028
2028- ( None , None )
2029+ None
20292030 }
20302031
20312032 fn resolve_ident_in_module ( & mut self ,
0 commit comments