@@ -6,7 +6,7 @@ use borrow_check::{Context, MirBorrowckCtxt, WriteKind};
6
6
use rustc:: ty:: { self , TyCtxt } ;
7
7
use rustc:: mir:: {
8
8
CastKind , ConstraintCategory , FakeReadCause , Local , Location , Mir , Operand ,
9
- Place , Projection , ProjectionElem , Rvalue , Statement , StatementKind ,
9
+ Place , NeoPlace , PlaceBase , ProjectionElem , Rvalue , Statement , StatementKind ,
10
10
TerminatorKind
11
11
} ;
12
12
use rustc_errors:: DiagnosticBuilder ;
@@ -422,7 +422,10 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
422
422
// it which simplifies the termination logic.
423
423
let mut queue = vec ! [ location] ;
424
424
let mut target = if let Some ( & Statement {
425
- kind : StatementKind :: Assign ( Place :: Local ( local) , _) ,
425
+ kind : StatementKind :: Assign ( NeoPlace {
426
+ base : PlaceBase :: Local ( local) ,
427
+ elems : & [ ] ,
428
+ } , _) ,
426
429
..
427
430
} ) = stmt {
428
431
local
@@ -446,11 +449,16 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
446
449
box rvalue,
447
450
) = & stmt. kind {
448
451
let into = match place {
449
- Place :: Local ( into) => into,
450
- Place :: Projection ( box Projection {
451
- base : Place :: Local ( into) ,
452
- elem : ProjectionElem :: Deref ,
453
- } ) => into,
452
+ NeoPlace {
453
+ base : PlaceBase :: Local ( into) ,
454
+ elems : & [ ] ,
455
+ } => into,
456
+
457
+ NeoPlace {
458
+ base : PlaceBase :: Local ( into) ,
459
+ elems,
460
+ } if elems. last ( ) . unwrap ( ) == & ProjectionElem :: Deref => into,
461
+
454
462
_ => {
455
463
// Continue at the next location.
456
464
queue. push ( current_location. successor_within_block ( ) ) ;
0 commit comments