@@ -13,7 +13,7 @@ use rustc_span::{Ident, Span, kw, sym};
1313use tracing:: { debug, instrument} ;
1414
1515use crate :: errors:: { ParamKindInEnumDiscriminant , ParamKindInNonTrivialAnonConst } ;
16- use crate :: imports:: Import ;
16+ use crate :: imports:: { Import , Progress } ;
1717use crate :: late:: { ConstantHasGenerics , NoConstantGenericsReason , PathSource , Rib , RibKind } ;
1818use crate :: macros:: { MacroRulesScope , sub_namespace_match} ;
1919use crate :: {
@@ -983,12 +983,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
983983 if source != target {
984984 // This branch allows the binding to be defined or updated later if the target name
985985 // can hide the source.
986- if bindings. iter ( ) . all ( |binding| binding. get ( ) . is_pending ( ) ) {
986+ if bindings. iter ( ) . all ( |binding| {
987+ matches ! ( binding. get( ) , Progress :: Pending | Progress :: Ready ( None ) )
988+ } ) {
987989 // None of the target bindings are available, so we can't determine
988990 // if this binding is correct or not.
989991 // See more details in #124840
990992 return Err ( ( Undetermined , Weak :: No ) ) ;
991- } else if bindings[ ns] . get ( ) . is_pending ( ) && binding. is_some ( ) {
993+ } else if matches ! ( bindings[ ns] . get( ) , Progress :: Pending | Progress :: Ready ( None ) )
994+ && binding. is_some ( )
995+ {
992996 // `binding.is_some()` avoids the condition where the binding
993997 // truly doesn't exist in this namespace and should return `Err(Determined)`.
994998 return Err ( ( Undetermined , Weak :: No ) ) ;
0 commit comments