@@ -231,7 +231,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
231
231
tcx,
232
232
param_env
233
233
} ;
234
- let dropee = dropee_ptr . deref ( tcx ) ;
234
+ let dropee = tcx . mk_place_deref ( dropee_ptr ) ;
235
235
let resume_block = elaborator. patch . resume_block ( ) ;
236
236
elaborate_drops:: elaborate_drop (
237
237
& mut elaborator,
@@ -312,7 +312,7 @@ fn build_clone_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'tcx>) -
312
312
let is_copy = self_ty. is_copy_modulo_regions ( tcx, param_env, builder. span ) ;
313
313
314
314
let dest = Place :: return_place ( ) ;
315
- let src = Place :: from ( Local :: new ( 1 +0 ) ) . deref ( tcx ) ;
315
+ let src = tcx . mk_place_deref ( Place :: from ( Local :: new ( 1 +0 ) ) ) ;
316
316
317
317
match self_ty. kind {
318
318
_ if is_copy => builder. copy_shim ( ) ,
@@ -415,7 +415,7 @@ impl CloneShimBuilder<'tcx> {
415
415
}
416
416
417
417
fn copy_shim ( & mut self ) {
418
- let rcvr = Place :: from ( Local :: new ( 1 +0 ) ) . deref ( self . tcx ) ;
418
+ let rcvr = self . tcx . mk_place_deref ( Place :: from ( Local :: new ( 1 +0 ) ) ) ;
419
419
let ret_statement = self . make_statement (
420
420
StatementKind :: Assign (
421
421
box (
@@ -561,8 +561,8 @@ impl CloneShimBuilder<'tcx> {
561
561
// BB #2
562
562
// `dest[i] = Clone::clone(src[beg])`;
563
563
// Goto #3 if ok, #5 if unwinding happens.
564
- let dest_field = dest. clone ( ) . index ( beg , self . tcx ) ;
565
- let src_field = src . index ( beg , self . tcx ) ;
564
+ let dest_field = self . tcx . mk_place_index ( dest. clone ( ) , beg ) ;
565
+ let src_field = self . tcx . mk_place_index ( src , beg ) ;
566
566
self . make_clone_call ( dest_field, src_field, ty, BasicBlock :: new ( 3 ) ,
567
567
BasicBlock :: new ( 5 ) ) ;
568
568
@@ -616,7 +616,7 @@ impl CloneShimBuilder<'tcx> {
616
616
// BB #7 (cleanup)
617
617
// `drop(dest[beg])`;
618
618
self . block ( vec ! [ ] , TerminatorKind :: Drop {
619
- location : dest . index ( beg , self . tcx ) ,
619
+ location : self . tcx . mk_place_index ( dest , beg ) ,
620
620
target : BasicBlock :: new ( 8 ) ,
621
621
unwind : None ,
622
622
} , true ) ;
@@ -648,9 +648,9 @@ impl CloneShimBuilder<'tcx> {
648
648
let mut previous_field = None ;
649
649
for ( i, ity) in tys. enumerate ( ) {
650
650
let field = Field :: new ( i) ;
651
- let src_field = src. clone ( ) . field ( field , ity , self . tcx ) ;
651
+ let src_field = self . tcx . mk_place_field ( src. clone ( ) , field , ity ) ;
652
652
653
- let dest_field = dest. clone ( ) . field ( field , ity , self . tcx ) ;
653
+ let dest_field = self . tcx . mk_place_field ( dest. clone ( ) , field , ity ) ;
654
654
655
655
// #(2i + 1) is the cleanup block for the previous clone operation
656
656
let cleanup_block = self . block_index_offset ( 1 ) ;
@@ -721,14 +721,14 @@ fn build_call_shim<'tcx>(
721
721
722
722
let rcvr = match rcvr_adjustment {
723
723
Adjustment :: Identity => Operand :: Move ( rcvr_l) ,
724
- Adjustment :: Deref => Operand :: Copy ( rcvr_l . deref ( tcx ) ) ,
724
+ Adjustment :: Deref => Operand :: Copy ( tcx . mk_place_deref ( rcvr_l ) ) ,
725
725
Adjustment :: DerefMove => {
726
726
// fn(Self, ...) -> fn(*mut Self, ...)
727
727
let arg_ty = local_decls[ rcvr_arg] . ty ;
728
728
debug_assert ! ( tcx. generics_of( def_id) . has_self && arg_ty == tcx. types. self_param) ;
729
729
local_decls[ rcvr_arg] . ty = tcx. mk_mut_ptr ( arg_ty) ;
730
730
731
- Operand :: Move ( rcvr_l . deref ( tcx ) )
731
+ Operand :: Move ( tcx . mk_place_deref ( rcvr_l ) )
732
732
}
733
733
Adjustment :: RefMut => {
734
734
// let rcvr = &mut rcvr;
@@ -772,7 +772,7 @@ fn build_call_shim<'tcx>(
772
772
if let Some ( untuple_args) = untuple_args {
773
773
args. extend ( untuple_args. iter ( ) . enumerate ( ) . map ( |( i, ity) | {
774
774
let arg_place = Place :: from ( Local :: new ( 1 +1 ) ) ;
775
- Operand :: Move ( arg_place . field ( Field :: new ( i) , * ity, tcx ) )
775
+ Operand :: Move ( tcx . mk_place_field ( arg_place , Field :: new ( i) , * ity) )
776
776
} ) ) ;
777
777
} else {
778
778
args. extend ( ( 1 ..sig. inputs ( ) . len ( ) ) . map ( |i| {
0 commit comments