Skip to content

Commit ef4f486

Browse files
committed
Use dest,src ordering for make_clone_call
1 parent 48a7a1f commit ef4f486

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/librustc_mir/shim.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -403,11 +403,11 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
403403

404404
fn make_clone_call(
405405
&mut self,
406+
dest: Place<'tcx>,
407+
src: Place<'tcx>,
406408
ty: Ty<'tcx>,
407-
rcvr_field: Place<'tcx>,
408409
next: BasicBlock,
409-
cleanup: BasicBlock,
410-
dest: Place<'tcx>
410+
cleanup: BasicBlock
411411
) {
412412
let tcx = self.tcx;
413413

@@ -439,11 +439,11 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
439439
})
440440
);
441441

442-
// `let ref_loc: &ty = &rcvr_field;`
442+
// `let ref_loc: &ty = &src;`
443443
let statement = self.make_statement(
444444
StatementKind::Assign(
445445
ref_loc.clone(),
446-
Rvalue::Ref(tcx.types.re_erased, BorrowKind::Shared, rcvr_field)
446+
Rvalue::Ref(tcx.types.re_erased, BorrowKind::Shared, src)
447447
)
448448
);
449449

@@ -537,8 +537,8 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
537537
// Goto #3 if ok, #5 if unwinding happens.
538538
let rcvr_field = rcvr.clone().index(beg);
539539
let cloned = self.make_place(Mutability::Not, ty);
540-
self.make_clone_call(ty, rcvr_field, BasicBlock::new(3),
541-
BasicBlock::new(5), cloned.clone());
540+
self.make_clone_call(cloned.clone(), rcvr_field, ty, BasicBlock::new(3),
541+
BasicBlock::new(5));
542542

543543
// BB #3
544544
// `ret[beg] = cloned;`
@@ -639,11 +639,11 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
639639
// `returns[i] = Clone::clone(&rcvr.i);`
640640
// Goto #(2i + 2) if ok, #(2i + 1) if unwinding happens.
641641
self.make_clone_call(
642-
*ity,
642+
place.clone(),
643643
rcvr_field,
644+
*ity,
644645
BasicBlock::new(2 * i + 2),
645646
BasicBlock::new(2 * i + 1),
646-
place.clone()
647647
);
648648

649649
// BB #(2i + 1) (cleanup)

0 commit comments

Comments
 (0)