@@ -209,9 +209,11 @@ fn compare_method_predicate_entailment<'tcx>(
209
209
//
210
210
// We then register the obligations from the impl_m and check to see
211
211
// if all constraints hold.
212
- hybrid_preds
213
- . predicates
214
- . extend ( trait_m_predicates. instantiate_own ( tcx, trait_to_placeholder_substs) . predicates ) ;
212
+ hybrid_preds. predicates . extend (
213
+ trait_m_predicates
214
+ . instantiate_own ( tcx, trait_to_placeholder_substs)
215
+ . map ( |( predicate, _) | predicate) ,
216
+ ) ;
215
217
216
218
// Construct trait parameter environment and then shift it into the placeholder viewpoint.
217
219
// The key step here is to update the caller_bounds's predicates to be
@@ -230,7 +232,7 @@ fn compare_method_predicate_entailment<'tcx>(
230
232
debug ! ( "compare_impl_method: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
231
233
232
234
let impl_m_own_bounds = impl_m_predicates. instantiate_own ( tcx, impl_to_placeholder_substs) ;
233
- for ( predicate, span) in iter :: zip ( impl_m_own_bounds. predicates , impl_m_own_bounds . spans ) {
235
+ for ( predicate, span) in impl_m_own_bounds {
234
236
let normalize_cause = traits:: ObligationCause :: misc ( span, impl_m_hir_id) ;
235
237
let predicate = ocx. normalize ( & normalize_cause, param_env, predicate) ;
236
238
@@ -1828,8 +1830,7 @@ fn compare_type_predicate_entailment<'tcx>(
1828
1830
check_region_bounds_on_impl_item ( tcx, impl_ty, trait_ty, false ) ?;
1829
1831
1830
1832
let impl_ty_own_bounds = impl_ty_predicates. instantiate_own ( tcx, impl_substs) ;
1831
-
1832
- if impl_ty_own_bounds. is_empty ( ) {
1833
+ if impl_ty_own_bounds. len ( ) == 0 {
1833
1834
// Nothing to check.
1834
1835
return Ok ( ( ) ) ;
1835
1836
}
@@ -1844,9 +1845,11 @@ fn compare_type_predicate_entailment<'tcx>(
1844
1845
// associated type in the trait are assumed.
1845
1846
let impl_predicates = tcx. predicates_of ( impl_ty_predicates. parent . unwrap ( ) ) ;
1846
1847
let mut hybrid_preds = impl_predicates. instantiate_identity ( tcx) ;
1847
- hybrid_preds
1848
- . predicates
1849
- . extend ( trait_ty_predicates. instantiate_own ( tcx, trait_to_impl_substs) . predicates ) ;
1848
+ hybrid_preds. predicates . extend (
1849
+ trait_ty_predicates
1850
+ . instantiate_own ( tcx, trait_to_impl_substs)
1851
+ . map ( |( predicate, _) | predicate) ,
1852
+ ) ;
1850
1853
1851
1854
debug ! ( "compare_type_predicate_entailment: bounds={:?}" , hybrid_preds) ;
1852
1855
@@ -1862,9 +1865,7 @@ fn compare_type_predicate_entailment<'tcx>(
1862
1865
1863
1866
debug ! ( "compare_type_predicate_entailment: caller_bounds={:?}" , param_env. caller_bounds( ) ) ;
1864
1867
1865
- assert_eq ! ( impl_ty_own_bounds. predicates. len( ) , impl_ty_own_bounds. spans. len( ) ) ;
1866
- for ( span, predicate) in std:: iter:: zip ( impl_ty_own_bounds. spans , impl_ty_own_bounds. predicates )
1867
- {
1868
+ for ( predicate, span) in impl_ty_own_bounds {
1868
1869
let cause = ObligationCause :: misc ( span, impl_ty_hir_id) ;
1869
1870
let predicate = ocx. normalize ( & cause, param_env, predicate) ;
1870
1871
0 commit comments