@@ -1743,7 +1743,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1743
1743
if let Some ( ( place_base, ProjectionElem :: Subslice { from, to, from_end : false } ) ) =
1744
1744
place_span. 0 . last_projection ( )
1745
1745
{
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 ) ;
1747
1747
if let ty:: Array ( ..) = place_ty. ty . kind ( ) {
1748
1748
self . check_if_subslice_element_is_moved (
1749
1749
location,
@@ -1854,7 +1854,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1854
1854
// assigning to `P.f` requires `P` itself
1855
1855
// be already initialized
1856
1856
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 ;
1858
1858
match base_ty. kind ( ) {
1859
1859
ty:: Adt ( def, _) if def. has_dtor ( tcx) => {
1860
1860
self . check_if_path_or_subpath_is_moved (
@@ -1951,7 +1951,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
1951
1951
// no move out from an earlier location) then this is an attempt at initialization
1952
1952
// of the union - we should error in that case.
1953
1953
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 ( ) {
1955
1955
if def. is_union ( ) {
1956
1956
if this. move_data . path_map [ mpi] . iter ( ) . any ( |moi| {
1957
1957
this. move_data . moves [ * moi] . source . is_predecessor_of ( location, this. body )
@@ -2173,7 +2173,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
2173
2173
Some ( ( place_base, elem) ) => {
2174
2174
match elem {
2175
2175
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 ;
2177
2177
2178
2178
// Check the kind of deref to decide
2179
2179
match base_ty. kind ( ) {
0 commit comments