@@ -221,7 +221,7 @@ fn compare_predicate_entailment<'tcx>(
221
221
let impl_m_own_bounds = impl_m_predicates. instantiate_own ( tcx, impl_to_placeholder_substs) ;
222
222
for ( predicate, span) in iter:: zip ( impl_m_own_bounds. predicates , impl_m_own_bounds. spans ) {
223
223
let normalize_cause = traits:: ObligationCause :: misc ( span, impl_m_hir_id) ;
224
- let predicate = ocx. normalize ( normalize_cause, param_env, predicate) ;
224
+ let predicate = ocx. normalize ( & normalize_cause, param_env, predicate) ;
225
225
226
226
let cause = ObligationCause :: new (
227
227
span,
@@ -260,7 +260,7 @@ fn compare_predicate_entailment<'tcx>(
260
260
) ;
261
261
262
262
let norm_cause = ObligationCause :: misc ( impl_m_span, impl_m_hir_id) ;
263
- let impl_sig = ocx. normalize ( norm_cause. clone ( ) , param_env, impl_sig) ;
263
+ let impl_sig = ocx. normalize ( & norm_cause, param_env, impl_sig) ;
264
264
let impl_fty = tcx. mk_fn_ptr ( ty:: Binder :: dummy ( impl_sig) ) ;
265
265
debug ! ( "compare_impl_method: impl_fty={:?}" , impl_fty) ;
266
266
@@ -271,7 +271,7 @@ fn compare_predicate_entailment<'tcx>(
271
271
// we have to do this before normalization, since the normalized ty may
272
272
// not contain the input parameters. See issue #87748.
273
273
wf_tys. extend ( trait_sig. inputs_and_output . iter ( ) ) ;
274
- let trait_sig = ocx. normalize ( norm_cause, param_env, trait_sig) ;
274
+ let trait_sig = ocx. normalize ( & norm_cause, param_env, trait_sig) ;
275
275
// We also have to add the normalized trait signature
276
276
// as we don't normalize during implied bounds computation.
277
277
wf_tys. extend ( trait_sig. inputs_and_output . iter ( ) ) ;
@@ -366,7 +366,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
366
366
// Normalize the impl signature with fresh variables for lifetime inference.
367
367
let norm_cause = ObligationCause :: misc ( return_span, impl_m_hir_id) ;
368
368
let impl_sig = ocx. normalize (
369
- norm_cause. clone ( ) ,
369
+ & norm_cause,
370
370
param_env,
371
371
infcx. replace_bound_vars_with_fresh_vars (
372
372
return_span,
@@ -387,7 +387,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
387
387
tcx. bound_fn_sig ( trait_m. def_id ) . subst ( tcx, trait_to_placeholder_substs) ,
388
388
)
389
389
. fold_with ( & mut collector) ;
390
- let trait_sig = ocx. normalize ( norm_cause. clone ( ) , param_env, unnormalized_trait_sig) ;
390
+ let trait_sig = ocx. normalize ( & norm_cause, param_env, unnormalized_trait_sig) ;
391
391
let trait_return_ty = trait_sig. output ( ) ;
392
392
393
393
let wf_tys = FxIndexSet :: from_iter (
@@ -592,7 +592,7 @@ impl<'tcx> TypeFolder<'tcx> for ImplTraitInTraitCollector<'_, 'tcx> {
592
592
for ( pred, pred_span) in self . tcx ( ) . bound_explicit_item_bounds ( proj. item_def_id ) . subst_iter_copied ( self . tcx ( ) , proj. substs ) {
593
593
let pred = pred. fold_with ( self ) ;
594
594
let pred = self . ocx . normalize (
595
- ObligationCause :: misc ( self . span , self . body_id ) ,
595
+ & ObligationCause :: misc ( self . span , self . body_id ) ,
596
596
self . param_env ,
597
597
pred,
598
598
) ;
@@ -1403,11 +1403,11 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
1403
1403
) ;
1404
1404
1405
1405
// There is no "body" here, so just pass dummy id.
1406
- let impl_ty = ocx. normalize ( cause. clone ( ) , param_env, impl_ty) ;
1406
+ let impl_ty = ocx. normalize ( & cause, param_env, impl_ty) ;
1407
1407
1408
1408
debug ! ( "compare_const_impl: impl_ty={:?}" , impl_ty) ;
1409
1409
1410
- let trait_ty = ocx. normalize ( cause. clone ( ) , param_env, trait_ty) ;
1410
+ let trait_ty = ocx. normalize ( & cause, param_env, trait_ty) ;
1411
1411
1412
1412
debug ! ( "compare_const_impl: trait_ty={:?}" , trait_ty) ;
1413
1413
@@ -1556,7 +1556,7 @@ fn compare_type_predicate_entailment<'tcx>(
1556
1556
for ( span, predicate) in std:: iter:: zip ( impl_ty_own_bounds. spans , impl_ty_own_bounds. predicates )
1557
1557
{
1558
1558
let cause = ObligationCause :: misc ( span, impl_ty_hir_id) ;
1559
- let predicate = ocx. normalize ( cause, param_env, predicate) ;
1559
+ let predicate = ocx. normalize ( & cause, param_env, predicate) ;
1560
1560
1561
1561
let cause = ObligationCause :: new (
1562
1562
span,
@@ -1778,7 +1778,7 @@ pub fn check_type_bounds<'tcx>(
1778
1778
1779
1779
for mut obligation in util:: elaborate_obligations ( tcx, obligations) {
1780
1780
let normalized_predicate =
1781
- ocx. normalize ( normalize_cause. clone ( ) , normalize_param_env, obligation. predicate ) ;
1781
+ ocx. normalize ( & normalize_cause, normalize_param_env, obligation. predicate ) ;
1782
1782
debug ! ( "compare_projection_bounds: normalized predicate = {:?}" , normalized_predicate) ;
1783
1783
obligation. predicate = normalized_predicate;
1784
1784
0 commit comments