@@ -1889,12 +1889,13 @@ impl<'a> Resolver<'a> {
1889
1889
}
1890
1890
1891
1891
ident. span = ident. span . modern ( ) ;
1892
+ let mut poisoned = None ;
1892
1893
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 {
1894
1895
self . hygienic_lexical_parent_with_compatibility_fallback ( module, & mut ident. span ,
1895
- node_id)
1896
+ node_id, & mut poisoned )
1896
1897
} else {
1897
- ( self . hygienic_lexical_parent ( module, & mut ident. span ) , None )
1898
+ self . hygienic_lexical_parent ( module, & mut ident. span )
1898
1899
} ;
1899
1900
module = unwrap_or ! ( opt_module, break ) ;
1900
1901
let orig_current_module = self . current_module ;
@@ -1917,9 +1918,9 @@ impl<'a> Resolver<'a> {
1917
1918
}
1918
1919
return Some ( LexicalScopeBinding :: Item ( binding) )
1919
1920
}
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" ) ,
1923
1924
}
1924
1925
}
1925
1926
@@ -1965,12 +1966,12 @@ impl<'a> Resolver<'a> {
1965
1966
None
1966
1967
}
1967
1968
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 > > {
1972
1973
if let module @ Some ( ..) = self . hygienic_lexical_parent ( module, span) {
1973
- return ( module, None ) ;
1974
+ return module;
1974
1975
}
1975
1976
1976
1977
// We need to support the next case under a deprecation warning
@@ -1991,13 +1992,14 @@ impl<'a> Resolver<'a> {
1991
1992
// The macro is a proc macro derive
1992
1993
if module. expansion . looks_like_proc_macro_derive ( ) {
1993
1994
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 ;
1995
1997
}
1996
1998
}
1997
1999
}
1998
2000
}
1999
2001
2000
- ( None , None )
2002
+ None
2001
2003
}
2002
2004
2003
2005
fn resolve_ident_in_module ( & mut self ,
0 commit comments