@@ -308,10 +308,7 @@ fn build_clone_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'tcx>) -
308308
309309 match self_ty. kind ( ) {
310310 _ if is_copy => builder. copy_shim ( ) ,
311- ty:: Array ( ty, len) => {
312- let len = len. eval_usize ( tcx, param_env) ;
313- builder. array_shim ( dest, src, ty, len)
314- }
311+ ty:: Array ( ty, len) => builder. array_shim ( dest, src, ty, len) ,
315312 ty:: Closure ( _, substs) => {
316313 builder. tuple_like_shim ( dest, src, substs. as_closure ( ) . upvar_tys ( ) )
317314 }
@@ -485,7 +482,13 @@ impl CloneShimBuilder<'tcx> {
485482 }
486483 }
487484
488- fn array_shim ( & mut self , dest : Place < ' tcx > , src : Place < ' tcx > , ty : Ty < ' tcx > , len : u64 ) {
485+ fn array_shim (
486+ & mut self ,
487+ dest : Place < ' tcx > ,
488+ src : Place < ' tcx > ,
489+ ty : Ty < ' tcx > ,
490+ len : & ' tcx ty:: Const < ' tcx > ,
491+ ) {
489492 let tcx = self . tcx ;
490493 let span = self . span ;
491494
@@ -503,7 +506,11 @@ impl CloneShimBuilder<'tcx> {
503506 ) ) ) ,
504507 self . make_statement( StatementKind :: Assign ( box (
505508 end,
506- Rvalue :: Use ( Operand :: Constant ( self . make_usize( len) ) ) ,
509+ Rvalue :: Use ( Operand :: Constant ( box Constant {
510+ span: self . span,
511+ user_ty: None ,
512+ literal: len,
513+ } ) ) ,
507514 ) ) ) ,
508515 ] ;
509516 self . block ( inits, TerminatorKind :: Goto { target : BasicBlock :: new ( 1 ) } , false ) ;
0 commit comments