@@ -231,7 +231,7 @@ fn build_drop_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, ty: Option<Ty<'tcx>>)
231231 tcx,
232232 param_env
233233 } ;
234- let dropee = dropee_ptr . deref ( tcx ) ;
234+ let dropee = tcx . mk_place_deref ( dropee_ptr ) ;
235235 let resume_block = elaborator. patch . resume_block ( ) ;
236236 elaborate_drops:: elaborate_drop (
237237 & mut elaborator,
@@ -312,7 +312,7 @@ fn build_clone_shim<'tcx>(tcx: TyCtxt<'tcx>, def_id: DefId, self_ty: Ty<'tcx>) -
312312 let is_copy = self_ty. is_copy_modulo_regions ( tcx, param_env, builder. span ) ;
313313
314314 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 ) ) ) ;
316316
317317 match self_ty. kind {
318318 _ if is_copy => builder. copy_shim ( ) ,
@@ -415,7 +415,7 @@ impl CloneShimBuilder<'tcx> {
415415 }
416416
417417 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 ) ) ) ;
419419 let ret_statement = self . make_statement (
420420 StatementKind :: Assign (
421421 box (
@@ -561,8 +561,8 @@ impl CloneShimBuilder<'tcx> {
561561 // BB #2
562562 // `dest[i] = Clone::clone(src[beg])`;
563563 // 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 ) ;
566566 self . make_clone_call ( dest_field, src_field, ty, BasicBlock :: new ( 3 ) ,
567567 BasicBlock :: new ( 5 ) ) ;
568568
@@ -616,7 +616,7 @@ impl CloneShimBuilder<'tcx> {
616616 // BB #7 (cleanup)
617617 // `drop(dest[beg])`;
618618 self . block ( vec ! [ ] , TerminatorKind :: Drop {
619- location : dest . index ( beg , self . tcx ) ,
619+ location : self . tcx . mk_place_index ( dest , beg ) ,
620620 target : BasicBlock :: new ( 8 ) ,
621621 unwind : None ,
622622 } , true ) ;
@@ -648,9 +648,9 @@ impl CloneShimBuilder<'tcx> {
648648 let mut previous_field = None ;
649649 for ( i, ity) in tys. enumerate ( ) {
650650 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 ) ;
652652
653- let dest_field = dest. clone ( ) . field ( field , ity , self . tcx ) ;
653+ let dest_field = self . tcx . mk_place_field ( dest. clone ( ) , field , ity ) ;
654654
655655 // #(2i + 1) is the cleanup block for the previous clone operation
656656 let cleanup_block = self . block_index_offset ( 1 ) ;
@@ -721,14 +721,14 @@ fn build_call_shim<'tcx>(
721721
722722 let rcvr = match rcvr_adjustment {
723723 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 ) ) ,
725725 Adjustment :: DerefMove => {
726726 // fn(Self, ...) -> fn(*mut Self, ...)
727727 let arg_ty = local_decls[ rcvr_arg] . ty ;
728728 debug_assert ! ( tcx. generics_of( def_id) . has_self && arg_ty == tcx. types. self_param) ;
729729 local_decls[ rcvr_arg] . ty = tcx. mk_mut_ptr ( arg_ty) ;
730730
731- Operand :: Move ( rcvr_l . deref ( tcx ) )
731+ Operand :: Move ( tcx . mk_place_deref ( rcvr_l ) )
732732 }
733733 Adjustment :: RefMut => {
734734 // let rcvr = &mut rcvr;
@@ -772,7 +772,7 @@ fn build_call_shim<'tcx>(
772772 if let Some ( untuple_args) = untuple_args {
773773 args. extend ( untuple_args. iter ( ) . enumerate ( ) . map ( |( i, ity) | {
774774 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) )
776776 } ) ) ;
777777 } else {
778778 args. extend ( ( 1 ..sig. inputs ( ) . len ( ) ) . map ( |i| {
0 commit comments