@@ -336,8 +336,7 @@ impl<'tcx> CloneShimBuilder<'tcx> {
336336 // we must subst the self_ty because it's
337337 // otherwise going to be TySelf and we can't index
338338 // or access fields of a Place of type TySelf.
339- let substs = tcx. mk_substs_trait ( self_ty, [ ] ) ;
340- let sig = tcx. bound_fn_sig ( def_id) . subst ( tcx, substs) ;
339+ let sig = tcx. bound_fn_sig ( def_id) . subst ( tcx, & [ self_ty. into ( ) ] ) ;
341340 let sig = tcx. erase_late_bound_regions ( sig) ;
342341 let span = tcx. def_span ( def_id) ;
343342
@@ -573,9 +572,8 @@ fn build_call_shim<'tcx>(
573572
574573 // Create substitutions for the `Self` and `Args` generic parameters of the shim body.
575574 let arg_tup = tcx. mk_tup ( untuple_args. iter ( ) ) ;
576- let sig_substs = tcx. mk_substs_trait ( ty, [ ty:: subst:: GenericArg :: from ( arg_tup) ] ) ;
577575
578- ( Some ( sig_substs ) , Some ( untuple_args) )
576+ ( Some ( [ ty . into ( ) , arg_tup . into ( ) ] ) , Some ( untuple_args) )
579577 } else {
580578 ( None , None )
581579 } ;
@@ -586,7 +584,7 @@ fn build_call_shim<'tcx>(
586584
587585 assert_eq ! ( sig_substs. is_some( ) , !instance. has_polymorphic_mir_body( ) ) ;
588586 let mut sig =
589- if let Some ( sig_substs) = sig_substs { sig. subst ( tcx, sig_substs) } else { sig. 0 } ;
587+ if let Some ( sig_substs) = sig_substs { sig. subst ( tcx, & sig_substs) } else { sig. 0 } ;
590588
591589 if let CallKind :: Indirect ( fnty) = call_kind {
592590 // `sig` determines our local decls, and thus the callee type in the `Call` terminator. This
0 commit comments