@@ -403,11 +403,11 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
403
403
404
404
fn make_clone_call (
405
405
& mut self ,
406
+ dest : Place < ' tcx > ,
407
+ src : Place < ' tcx > ,
406
408
ty : Ty < ' tcx > ,
407
- rcvr_field : Place < ' tcx > ,
408
409
next : BasicBlock ,
409
- cleanup : BasicBlock ,
410
- dest : Place < ' tcx >
410
+ cleanup : BasicBlock
411
411
) {
412
412
let tcx = self . tcx ;
413
413
@@ -439,11 +439,11 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
439
439
} )
440
440
) ;
441
441
442
- // `let ref_loc: &ty = &rcvr_field ;`
442
+ // `let ref_loc: &ty = &src ;`
443
443
let statement = self . make_statement (
444
444
StatementKind :: Assign (
445
445
ref_loc. clone ( ) ,
446
- Rvalue :: Ref ( tcx. types . re_erased , BorrowKind :: Shared , rcvr_field )
446
+ Rvalue :: Ref ( tcx. types . re_erased , BorrowKind :: Shared , src )
447
447
)
448
448
) ;
449
449
@@ -537,8 +537,8 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
537
537
// Goto #3 if ok, #5 if unwinding happens.
538
538
let rcvr_field = rcvr. clone ( ) . index ( beg) ;
539
539
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 ) ) ;
542
542
543
543
// BB #3
544
544
// `ret[beg] = cloned;`
@@ -639,11 +639,11 @@ impl<'a, 'tcx> CloneShimBuilder<'a, 'tcx> {
639
639
// `returns[i] = Clone::clone(&rcvr.i);`
640
640
// Goto #(2i + 2) if ok, #(2i + 1) if unwinding happens.
641
641
self . make_clone_call (
642
- * ity ,
642
+ place . clone ( ) ,
643
643
rcvr_field,
644
+ * ity,
644
645
BasicBlock :: new ( 2 * i + 2 ) ,
645
646
BasicBlock :: new ( 2 * i + 1 ) ,
646
- place. clone ( )
647
647
) ;
648
648
649
649
// BB #(2i + 1) (cleanup)
0 commit comments