@@ -1562,13 +1562,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
15621562 return true ;
15631563 }
15641564
1565- // Check if a bound would previously have been removed when normalizing
1566- // the param_env so that it can be given the lowest priority. See
1567- // #50825 for the motivation for this.
1568- let is_global = |cand : & ty:: PolyTraitPredicate < ' tcx > | {
1569- cand. is_global ( ) && !cand. has_late_bound_regions ( )
1570- } ;
1571-
15721565 // (*) Prefer `BuiltinCandidate { has_nested: false }`, `PointeeCandidate`,
15731566 // `DiscriminantKindCandidate`, and `ConstDestructCandidate` to anything else.
15741567 //
@@ -1629,10 +1622,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
16291622 // global, prefer the projection or object candidate. See issue
16301623 // #50825 and #89352.
16311624 ( ObjectCandidate ( _) | ProjectionCandidate ( _) , ParamCandidate ( ref cand) ) => {
1632- sized_predicate || is_global ( cand )
1625+ sized_predicate || cand . is_global ( )
16331626 }
16341627 ( ParamCandidate ( ref cand) , ObjectCandidate ( _) | ProjectionCandidate ( _) ) => {
1635- !( sized_predicate || is_global ( cand ) )
1628+ !( sized_predicate || cand . is_global ( ) )
16361629 }
16371630
16381631 // Global bounds from the where clause should be ignored
@@ -1651,7 +1644,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
16511644 | TraitUpcastingUnsizeCandidate ( _)
16521645 | BuiltinCandidate { .. }
16531646 | TraitAliasCandidate ( ..) ,
1654- ) => !is_global ( cand ) ,
1647+ ) => !cand . is_global ( ) ,
16551648 (
16561649 ImplCandidate ( _)
16571650 | ClosureCandidate
@@ -1666,7 +1659,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
16661659 ) => {
16671660 // Prefer these to a global where-clause bound
16681661 // (see issue #50825).
1669- is_global ( cand ) && other. evaluation . must_apply_modulo_regions ( )
1662+ cand . is_global ( ) && other. evaluation . must_apply_modulo_regions ( )
16701663 }
16711664
16721665 ( ProjectionCandidate ( i) , ProjectionCandidate ( j) )
0 commit comments