@@ -1901,12 +1901,13 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
19011901 }
19021902
19031903 ident. span = ident. span . modern ( ) ;
1904+ let mut poisoned = None ;
19041905 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 {
19061907 self . hygienic_lexical_parent_with_compatibility_fallback ( module, & mut ident. span ,
1907- node_id)
1908+ node_id, & mut poisoned )
19081909 } else {
1909- ( self . hygienic_lexical_parent ( module, & mut ident. span ) , None )
1910+ self . hygienic_lexical_parent ( module, & mut ident. span )
19101911 } ;
19111912 module = unwrap_or ! ( opt_module, break ) ;
19121913 let orig_current_module = self . current_module ;
@@ -1934,7 +1935,6 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
19341935 }
19351936 return Some ( LexicalScopeBinding :: Item ( binding) )
19361937 }
1937- _ if poisoned. is_some ( ) => break ,
19381938 Err ( Determined ) => continue ,
19391939 Err ( Undetermined ) =>
19401940 span_bug ! ( ident. span, "undetermined resolution during main resolution pass" ) ,
@@ -1994,12 +1994,12 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
19941994 None
19951995 }
19961996
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 > > {
20012001 if let module @ Some ( ..) = self . hygienic_lexical_parent ( module, span) {
2002- return ( module, None ) ;
2002+ return module;
20032003 }
20042004
20052005 // We need to support the next case under a deprecation warning
@@ -2020,13 +2020,14 @@ impl<'a, 'crateloader: 'a> Resolver<'a, 'crateloader> {
20202020 // The macro is a proc macro derive
20212021 if module. expansion . looks_like_proc_macro_derive ( ) {
20222022 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 ;
20242025 }
20252026 }
20262027 }
20272028 }
20282029
2029- ( None , None )
2030+ None
20302031 }
20312032
20322033 fn resolve_ident_in_module ( & mut self ,
0 commit comments