@@ -305,11 +305,10 @@ fn build_clone_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
305305 }
306306 ty:: TyClosure ( def_id, substs) => {
307307 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 < _ > > ( )
310309 )
311310 }
312- ty:: TyTuple ( tys, _) => builder. tuple_like_shim ( & * * tys, AggregateKind :: Tuple ) ,
311+ ty:: TyTuple ( tys, _) => builder. tuple_like_shim ( & * * tys) ,
313312 _ => {
314313 bug ! ( "clone shim for `{:?}` which is not `Copy` and is not an aggregate" , self_ty)
315314 }
@@ -625,12 +624,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
625624 self . block ( vec ! [ ] , TerminatorKind :: Resume , true ) ;
626625 }
627626
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 > ] ) {
634628 let rcvr = Place :: Local ( Local :: new ( 1 +0 ) ) . deref ( ) ;
635629
636630 let mut previous_place = None ;
0 commit comments