@@ -1743,7 +1743,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
17431743 if let Some ( ( place_base, ProjectionElem :: Subslice { from, to, from_end : false } ) ) =
17441744 place_span. 0 . last_projection ( )
17451745 {
1746- let place_ty = PlaceRef :: ty ( & place_base , self . body ( ) , self . infcx . tcx ) ;
1746+ let place_ty = place_base . ty ( self . body ( ) , self . infcx . tcx ) ;
17471747 if let ty:: Array ( ..) = place_ty. ty . kind ( ) {
17481748 self . check_if_subslice_element_is_moved (
17491749 location,
@@ -1854,7 +1854,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
18541854 // assigning to `P.f` requires `P` itself
18551855 // be already initialized
18561856 let tcx = self . infcx . tcx ;
1857- let base_ty = PlaceRef :: ty ( & place_base , self . body ( ) , tcx) . ty ;
1857+ let base_ty = place_base . ty ( self . body ( ) , tcx) . ty ;
18581858 match base_ty. kind ( ) {
18591859 ty:: Adt ( def, _) if def. has_dtor ( tcx) => {
18601860 self . check_if_path_or_subpath_is_moved (
@@ -1951,7 +1951,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
19511951 // no move out from an earlier location) then this is an attempt at initialization
19521952 // of the union - we should error in that case.
19531953 let tcx = this. infcx . tcx ;
1954- if let ty:: Adt ( def, _) = PlaceRef :: ty ( & base , this. body ( ) , tcx) . ty . kind ( ) {
1954+ if let ty:: Adt ( def, _) = base . ty ( this. body ( ) , tcx) . ty . kind ( ) {
19551955 if def. is_union ( ) {
19561956 if this. move_data . path_map [ mpi] . iter ( ) . any ( |moi| {
19571957 this. move_data . moves [ * moi] . source . is_predecessor_of ( location, this. body )
@@ -2173,7 +2173,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
21732173 Some ( ( place_base, elem) ) => {
21742174 match elem {
21752175 ProjectionElem :: Deref => {
2176- let base_ty = PlaceRef :: ty ( & place_base , self . body ( ) , self . infcx . tcx ) . ty ;
2176+ let base_ty = place_base . ty ( self . body ( ) , self . infcx . tcx ) . ty ;
21772177
21782178 // Check the kind of deref to decide
21792179 match base_ty. kind ( ) {
0 commit comments