@@ -13,7 +13,7 @@ use rustc_span::{Ident, Span, kw, sym};
13
13
use tracing:: { debug, instrument} ;
14
14
15
15
use crate :: errors:: { ParamKindInEnumDiscriminant , ParamKindInNonTrivialAnonConst } ;
16
- use crate :: imports:: Import ;
16
+ use crate :: imports:: { Import , Progress } ;
17
17
use crate :: late:: { ConstantHasGenerics , NoConstantGenericsReason , PathSource , Rib , RibKind } ;
18
18
use crate :: macros:: { MacroRulesScope , sub_namespace_match} ;
19
19
use crate :: {
@@ -983,12 +983,16 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
983
983
if source != target {
984
984
// This branch allows the binding to be defined or updated later if the target name
985
985
// 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
+ } ) {
987
989
// None of the target bindings are available, so we can't determine
988
990
// if this binding is correct or not.
989
991
// See more details in #124840
990
992
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
+ {
992
996
// `binding.is_some()` avoids the condition where the binding
993
997
// truly doesn't exist in this namespace and should return `Err(Determined)`.
994
998
return Err ( ( Undetermined , Weak :: No ) ) ;
0 commit comments