@@ -41,7 +41,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
41
41
let reason;
42
42
let access_place_desc = self . describe_place ( access_place) ;
43
43
44
- if let ( base_place, Some ( projection) ) = the_place_err. final_projection ( self . tcx ) {
44
+ if let ( base_place, Some ( projection) ) = the_place_err. split_projection ( self . tcx ) {
45
45
match projection {
46
46
ProjectionElem :: Deref => {
47
47
if base_place. base == PlaceBase :: Local ( Local :: new ( 1 ) )
@@ -188,7 +188,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
188
188
}
189
189
} ;
190
190
191
- if let ( base_place, Some ( projection) ) = the_place_err. final_projection ( self . tcx ) {
191
+ if let ( base_place, Some ( projection) ) = the_place_err. split_projection ( self . tcx ) {
192
192
match projection {
193
193
ProjectionElem :: Deref => {
194
194
if let PlaceBase :: Local ( local) = base_place. base {
@@ -360,7 +360,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
360
360
361
361
// Does this place refer to what the user sees as an upvar
362
362
fn is_upvar ( & self , place : & Place < ' tcx > ) -> bool {
363
- if let ( base_place, Some ( projection) ) = place. final_projection ( self . tcx ) {
363
+ if let ( base_place, Some ( projection) ) = place. split_projection ( self . tcx ) {
364
364
match projection {
365
365
ProjectionElem :: Field ( _, _) => {
366
366
let base_ty = base_place. ty ( self . mir , self . tcx ) . to_ty ( self . tcx ) ;
@@ -370,7 +370,7 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
370
370
if let (
371
371
ref base_place,
372
372
Some ( ProjectionElem :: Field ( upvar_index, _) ) ,
373
- ) = base_place. final_projection ( self . tcx ) {
373
+ ) = base_place. split_projection ( self . tcx ) {
374
374
let base_ty = base_place. ty ( self . mir , self . tcx ) . to_ty ( self . tcx ) ;
375
375
is_closure_or_generator ( base_ty)
376
376
&& self . mir . upvar_decls [ upvar_index. index ( ) ] . by_ref
0 commit comments