@@ -1562,13 +1562,6 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1562
1562
return true ;
1563
1563
}
1564
1564
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
-
1572
1565
// (*) Prefer `BuiltinCandidate { has_nested: false }`, `PointeeCandidate`,
1573
1566
// `DiscriminantKindCandidate`, and `ConstDestructCandidate` to anything else.
1574
1567
//
@@ -1629,10 +1622,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1629
1622
// global, prefer the projection or object candidate. See issue
1630
1623
// #50825 and #89352.
1631
1624
( ObjectCandidate ( _) | ProjectionCandidate ( _) , ParamCandidate ( ref cand) ) => {
1632
- sized_predicate || is_global ( cand )
1625
+ sized_predicate || cand . is_global ( )
1633
1626
}
1634
1627
( ParamCandidate ( ref cand) , ObjectCandidate ( _) | ProjectionCandidate ( _) ) => {
1635
- !( sized_predicate || is_global ( cand ) )
1628
+ !( sized_predicate || cand . is_global ( ) )
1636
1629
}
1637
1630
1638
1631
// Global bounds from the where clause should be ignored
@@ -1651,7 +1644,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1651
1644
| TraitUpcastingUnsizeCandidate ( _)
1652
1645
| BuiltinCandidate { .. }
1653
1646
| TraitAliasCandidate ( ..) ,
1654
- ) => !is_global ( cand ) ,
1647
+ ) => !cand . is_global ( ) ,
1655
1648
(
1656
1649
ImplCandidate ( _)
1657
1650
| ClosureCandidate
@@ -1666,7 +1659,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
1666
1659
) => {
1667
1660
// Prefer these to a global where-clause bound
1668
1661
// (see issue #50825).
1669
- is_global ( cand ) && other. evaluation . must_apply_modulo_regions ( )
1662
+ cand . is_global ( ) && other. evaluation . must_apply_modulo_regions ( )
1670
1663
}
1671
1664
1672
1665
( ProjectionCandidate ( i) , ProjectionCandidate ( j) )
0 commit comments