@@ -305,11 +305,10 @@ fn build_clone_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
305
305
}
306
306
ty:: TyClosure ( def_id, substs) => {
307
307
builder. tuple_like_shim (
308
- & substs. upvar_tys ( def_id, tcx) . collect :: < Vec < _ > > ( ) ,
309
- AggregateKind :: Closure ( def_id, substs)
308
+ & substs. upvar_tys ( def_id, tcx) . collect :: < Vec < _ > > ( )
310
309
)
311
310
}
312
- ty:: TyTuple ( tys, _) => builder. tuple_like_shim ( & * * tys, AggregateKind :: Tuple ) ,
311
+ ty:: TyTuple ( tys, _) => builder. tuple_like_shim ( & * * tys) ,
313
312
_ => {
314
313
bug ! ( "clone shim for `{:?}` which is not `Copy` and is not an aggregate" , self_ty)
315
314
}
@@ -625,12 +624,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
625
624
self . block ( vec ! [ ] , TerminatorKind :: Resume , true ) ;
626
625
}
627
626
628
- fn tuple_like_shim ( & mut self , tys : & [ ty:: Ty < ' tcx > ] , kind : AggregateKind < ' tcx > ) {
629
- match kind {
630
- AggregateKind :: Tuple | AggregateKind :: Closure ( ..) => ( ) ,
631
- _ => bug ! ( "only tuples and closures are accepted" ) ,
632
- } ;
633
-
627
+ fn tuple_like_shim ( & mut self , tys : & [ ty:: Ty < ' tcx > ] ) {
634
628
let rcvr = Place :: Local ( Local :: new ( 1 +0 ) ) . deref ( ) ;
635
629
636
630
let mut previous_place = None ;
0 commit comments