@@ -221,7 +221,7 @@ fn compare_predicate_entailment<'tcx>(
221221 let impl_m_own_bounds = impl_m_predicates. instantiate_own ( tcx, impl_to_placeholder_substs) ;
222222 for ( predicate, span) in iter:: zip ( impl_m_own_bounds. predicates , impl_m_own_bounds. spans ) {
223223 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) ;
225225
226226 let cause = ObligationCause :: new (
227227 span,
@@ -260,7 +260,7 @@ fn compare_predicate_entailment<'tcx>(
260260 ) ;
261261
262262 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) ;
264264 let impl_fty = tcx. mk_fn_ptr ( ty:: Binder :: dummy ( impl_sig) ) ;
265265 debug ! ( "compare_impl_method: impl_fty={:?}" , impl_fty) ;
266266
@@ -271,7 +271,7 @@ fn compare_predicate_entailment<'tcx>(
271271 // we have to do this before normalization, since the normalized ty may
272272 // not contain the input parameters. See issue #87748.
273273 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) ;
275275 // We also have to add the normalized trait signature
276276 // as we don't normalize during implied bounds computation.
277277 wf_tys. extend ( trait_sig. inputs_and_output . iter ( ) ) ;
@@ -366,7 +366,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
366366 // Normalize the impl signature with fresh variables for lifetime inference.
367367 let norm_cause = ObligationCause :: misc ( return_span, impl_m_hir_id) ;
368368 let impl_sig = ocx. normalize (
369- norm_cause. clone ( ) ,
369+ & norm_cause,
370370 param_env,
371371 infcx. replace_bound_vars_with_fresh_vars (
372372 return_span,
@@ -387,7 +387,7 @@ pub fn collect_trait_impl_trait_tys<'tcx>(
387387 tcx. bound_fn_sig ( trait_m. def_id ) . subst ( tcx, trait_to_placeholder_substs) ,
388388 )
389389 . 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) ;
391391 let trait_return_ty = trait_sig. output ( ) ;
392392
393393 let wf_tys = FxIndexSet :: from_iter (
@@ -592,7 +592,7 @@ impl<'tcx> TypeFolder<'tcx> for ImplTraitInTraitCollector<'_, 'tcx> {
592592 for ( pred, pred_span) in self . tcx ( ) . bound_explicit_item_bounds ( proj. item_def_id ) . subst_iter_copied ( self . tcx ( ) , proj. substs ) {
593593 let pred = pred. fold_with ( self ) ;
594594 let pred = self . ocx . normalize (
595- ObligationCause :: misc ( self . span , self . body_id ) ,
595+ & ObligationCause :: misc ( self . span , self . body_id ) ,
596596 self . param_env ,
597597 pred,
598598 ) ;
@@ -1403,11 +1403,11 @@ pub(crate) fn raw_compare_const_impl<'tcx>(
14031403 ) ;
14041404
14051405 // 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) ;
14071407
14081408 debug ! ( "compare_const_impl: impl_ty={:?}" , impl_ty) ;
14091409
1410- let trait_ty = ocx. normalize ( cause. clone ( ) , param_env, trait_ty) ;
1410+ let trait_ty = ocx. normalize ( & cause, param_env, trait_ty) ;
14111411
14121412 debug ! ( "compare_const_impl: trait_ty={:?}" , trait_ty) ;
14131413
@@ -1556,7 +1556,7 @@ fn compare_type_predicate_entailment<'tcx>(
15561556 for ( span, predicate) in std:: iter:: zip ( impl_ty_own_bounds. spans , impl_ty_own_bounds. predicates )
15571557 {
15581558 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) ;
15601560
15611561 let cause = ObligationCause :: new (
15621562 span,
@@ -1778,7 +1778,7 @@ pub fn check_type_bounds<'tcx>(
17781778
17791779 for mut obligation in util:: elaborate_obligations ( tcx, obligations) {
17801780 let normalized_predicate =
1781- ocx. normalize ( normalize_cause. clone ( ) , normalize_param_env, obligation. predicate ) ;
1781+ ocx. normalize ( & normalize_cause, normalize_param_env, obligation. predicate ) ;
17821782 debug ! ( "compare_projection_bounds: normalized predicate = {:?}" , normalized_predicate) ;
17831783 obligation. predicate = normalized_predicate;
17841784
0 commit comments