@@ -218,14 +218,11 @@ fn compare_predicate_entailment<'tcx>(
218
218
219
219
debug ! ( "compare_impl_method: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
220
220
221
- let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
222
221
let impl_m_own_bounds = impl_m_predicates. instantiate_own ( tcx, impl_to_placeholder_substs) ;
223
222
for ( predicate, span) in iter:: zip ( impl_m_own_bounds. predicates , impl_m_own_bounds. spans ) {
224
223
let normalize_cause = traits:: ObligationCause :: misc ( span, impl_m_hir_id) ;
225
- let traits:: Normalized { value : predicate, obligations } =
226
- traits:: normalize ( & mut selcx, param_env, normalize_cause, predicate) ;
224
+ let predicate = ocx. normalize ( normalize_cause, param_env, predicate) ;
227
225
228
- ocx. register_obligations ( obligations) ;
229
226
let cause = ObligationCause :: new (
230
227
span,
231
228
impl_m_hir_id,
@@ -1555,14 +1552,11 @@ fn compare_type_predicate_entailment<'tcx>(
1555
1552
1556
1553
debug ! ( "compare_type_predicate_entailment: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
1557
1554
1558
- let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
1559
-
1560
1555
assert_eq ! ( impl_ty_own_bounds. predicates. len( ) , impl_ty_own_bounds. spans. len( ) ) ;
1561
1556
for ( span, predicate) in std:: iter:: zip ( impl_ty_own_bounds. spans , impl_ty_own_bounds. predicates )
1562
1557
{
1563
1558
let cause = ObligationCause :: misc ( span, impl_ty_hir_id) ;
1564
- let traits:: Normalized { value : predicate, obligations } =
1565
- traits:: normalize ( & mut selcx, param_env, cause, predicate) ;
1559
+ let predicate = ocx. normalize ( cause, param_env, predicate) ;
1566
1560
1567
1561
let cause = ObligationCause :: new (
1568
1562
span,
@@ -1573,7 +1567,6 @@ fn compare_type_predicate_entailment<'tcx>(
1573
1567
kind : impl_ty. kind ,
1574
1568
} ,
1575
1569
) ;
1576
- ocx. register_obligations ( obligations) ;
1577
1570
ocx. register_obligation ( traits:: Obligation :: new ( tcx, cause, param_env, predicate) ) ;
1578
1571
}
1579
1572
@@ -1756,7 +1749,6 @@ pub fn check_type_bounds<'tcx>(
1756
1749
let assumed_wf_types =
1757
1750
ocx. assumed_wf_types ( param_env, impl_ty_span, impl_ty. def_id . expect_local ( ) ) ;
1758
1751
1759
- let mut selcx = traits:: SelectionContext :: new ( & infcx) ;
1760
1752
let normalize_cause = ObligationCause :: new (
1761
1753
impl_ty_span,
1762
1754
impl_ty_hir_id,
@@ -1785,16 +1777,11 @@ pub fn check_type_bounds<'tcx>(
1785
1777
debug ! ( "check_type_bounds: item_bounds={:?}" , obligations) ;
1786
1778
1787
1779
for mut obligation in util:: elaborate_obligations ( tcx, obligations) {
1788
- let traits:: Normalized { value : normalized_predicate, obligations } = traits:: normalize (
1789
- & mut selcx,
1790
- normalize_param_env,
1791
- normalize_cause. clone ( ) ,
1792
- obligation. predicate ,
1793
- ) ;
1780
+ let normalized_predicate =
1781
+ ocx. normalize ( normalize_cause. clone ( ) , normalize_param_env, obligation. predicate ) ;
1794
1782
debug ! ( "compare_projection_bounds: normalized predicate = {:?}" , normalized_predicate) ;
1795
1783
obligation. predicate = normalized_predicate;
1796
1784
1797
- ocx. register_obligations ( obligations) ;
1798
1785
ocx. register_obligation ( obligation) ;
1799
1786
}
1800
1787
// Check that all obligations are satisfied by the implementation's
0 commit comments