From c6140970f5fcb161c5cd72d0a1b842783b053e55 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Tue, 30 Jan 2018 11:55:50 +0530 Subject: [PATCH] Remove AggregateKind argument from tuple_like_shim --- src/librustc_mir/shim.rs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/librustc_mir/shim.rs b/src/librustc_mir/shim.rs index cc351368233c..28bdaa41297b 100644 --- a/src/librustc_mir/shim.rs +++ b/src/librustc_mir/shim.rs @@ -305,11 +305,10 @@ fn build_clone_shim<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } ty::TyClosure(def_id, substs) => { builder.tuple_like_shim( - &substs.upvar_tys(def_id, tcx).collect::>(), - AggregateKind::Closure(def_id, substs) + &substs.upvar_tys(def_id, tcx).collect::>() ) } - ty::TyTuple(tys, _) => builder.tuple_like_shim(&**tys, AggregateKind::Tuple), + ty::TyTuple(tys, _) => builder.tuple_like_shim(&**tys), _ => { bug!("clone shim for `{:?}` which is not `Copy` and is not an aggregate", self_ty) } @@ -625,12 +624,7 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> { self.block(vec![], TerminatorKind::Resume, true); } - fn tuple_like_shim(&mut self, tys: &[ty::Ty<'tcx>], kind: AggregateKind<'tcx>) { - match kind { - AggregateKind::Tuple | AggregateKind::Closure(..) => (), - _ => bug!("only tuples and closures are accepted"), - }; - + fn tuple_like_shim(&mut self, tys: &[ty::Ty<'tcx>]) { let rcvr = Place::Local(Local::new(1+0)).deref(); let mut previous_place = None;