@@ -6,7 +6,7 @@ use borrow_check::{Context, MirBorrowckCtxt, WriteKind};
66use rustc:: ty:: { self , TyCtxt } ;
77use rustc:: mir:: {
88 CastKind , ConstraintCategory , FakeReadCause , Local , Location , Mir , Operand ,
9- Place , Projection , ProjectionElem , Rvalue , Statement , StatementKind ,
9+ Place , NeoPlace , PlaceBase , ProjectionElem , Rvalue , Statement , StatementKind ,
1010 TerminatorKind
1111} ;
1212use rustc_errors:: DiagnosticBuilder ;
@@ -422,7 +422,10 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
422422 // it which simplifies the termination logic.
423423 let mut queue = vec ! [ location] ;
424424 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+ } , _) ,
426429 ..
427430 } ) = stmt {
428431 local
@@ -446,11 +449,16 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
446449 box rvalue,
447450 ) = & stmt. kind {
448451 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+
454462 _ => {
455463 // Continue at the next location.
456464 queue. push ( current_location. successor_within_block ( ) ) ;
0 commit comments