@@ -1889,12 +1889,13 @@ impl<'a> Resolver<'a> {
18891889 }
18901890
18911891 ident. span = ident. span . modern ( ) ;
1892+ let mut poisoned = None ;
18921893 loop {
1893- let ( opt_module, poisoned ) = if let Some ( node_id) = record_used_id {
1894+ let opt_module = if let Some ( node_id) = record_used_id {
18941895 self . hygienic_lexical_parent_with_compatibility_fallback ( module, & mut ident. span ,
1895- node_id)
1896+ node_id, & mut poisoned )
18961897 } else {
1897- ( self . hygienic_lexical_parent ( module, & mut ident. span ) , None )
1898+ self . hygienic_lexical_parent ( module, & mut ident. span )
18981899 } ;
18991900 module = unwrap_or ! ( opt_module, break ) ;
19001901 let orig_current_module = self . current_module ;
@@ -1917,9 +1918,9 @@ impl<'a> Resolver<'a> {
19171918 }
19181919 return Some ( LexicalScopeBinding :: Item ( binding) )
19191920 }
1920- _ if poisoned . is_some ( ) => break ,
1921- Err ( Undetermined ) => return None ,
1922- Err ( Determined ) => { }
1921+ Err ( Determined ) => continue ,
1922+ Err ( Undetermined ) =>
1923+ span_bug ! ( ident . span , "undetermined resolution during main resolution pass" ) ,
19231924 }
19241925 }
19251926
@@ -1965,12 +1966,12 @@ impl<'a> Resolver<'a> {
19651966 None
19661967 }
19671968
1968- fn hygienic_lexical_parent_with_compatibility_fallback (
1969- & mut self , module : Module < ' a > , span : & mut Span , node_id : NodeId
1970- ) -> ( Option < Module < ' a > > , /* poisoned */ Option < NodeId > )
1971- {
1969+ fn hygienic_lexical_parent_with_compatibility_fallback ( & mut self , module : Module < ' a > ,
1970+ span : & mut Span , node_id : NodeId ,
1971+ poisoned : & mut Option < NodeId > )
1972+ -> Option < Module < ' a > > {
19721973 if let module @ Some ( ..) = self . hygienic_lexical_parent ( module, span) {
1973- return ( module, None ) ;
1974+ return module;
19741975 }
19751976
19761977 // We need to support the next case under a deprecation warning
@@ -1991,13 +1992,14 @@ impl<'a> Resolver<'a> {
19911992 // The macro is a proc macro derive
19921993 if module. expansion . looks_like_proc_macro_derive ( ) {
19931994 if parent. expansion . is_descendant_of ( span. ctxt ( ) . outer ( ) ) {
1994- return ( module. parent , Some ( node_id) ) ;
1995+ * poisoned = Some ( node_id) ;
1996+ return module. parent ;
19951997 }
19961998 }
19971999 }
19982000 }
19992001
2000- ( None , None )
2002+ None
20012003 }
20022004
20032005 fn resolve_ident_in_module ( & mut self ,
0 commit comments