Remove AggregateKind argument from tuple_like_shim
This commit is contained in:
parent
7fd3c27345
commit
c6140970f5
@ -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::<Vec<_>>(),
|
||||
AggregateKind::Closure(def_id, substs)
|
||||
&substs.upvar_tys(def_id, tcx).collect::<Vec<_>>()
|
||||
)
|
||||
}
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user