@@ -4,6 +4,7 @@ use borrow_check::place_ext::PlaceExt;
4
4
use rustc:: mir:: { self , Location , Place , Mir } ;
5
5
use rustc:: ty:: TyCtxt ;
6
6
use rustc:: ty:: RegionVid ;
7
+ use rustc:: mir:: PlaceBase ;
7
8
8
9
use rustc_data_structures:: bit_set:: { BitSet , BitSetOperator } ;
9
10
use rustc_data_structures:: fx:: FxHashMap ;
@@ -188,8 +189,9 @@ impl<'a, 'gcx, 'tcx> Borrows<'a, 'gcx, 'tcx> {
188
189
place : & Place < ' tcx >
189
190
) {
190
191
debug ! ( "kill_borrows_on_place: place={:?}" , place) ;
191
- // Handle the `Place::Local(..)` case first and exit early.
192
- if let Place :: Local ( local) = place {
192
+ // Handle the `PlaceBase::Local(..)` case first and exit early.
193
+ let neo_place = self . tcx . as_new_place ( place) ;
194
+ if let Some ( PlaceBase :: Local ( local) ) = neo_place. as_place_base ( ) {
193
195
if let Some ( borrow_indices) = self . borrow_set . local_map . get ( & local) {
194
196
debug ! ( "kill_borrows_on_place: borrow_indices={:?}" , borrow_indices) ;
195
197
sets. kill_all ( borrow_indices) ;
@@ -260,13 +262,13 @@ impl<'a, 'gcx, 'tcx> BitDenotation<'tcx> for Borrows<'a, 'gcx, 'tcx> {
260
262
} ) ;
261
263
262
264
debug ! ( "Borrows::statement_effect: stmt={:?}" , stmt) ;
263
- match stmt. kind {
264
- mir:: StatementKind :: Assign ( ref lhs, ref rhs) => {
265
+ match & stmt. kind {
266
+ mir:: StatementKind :: Assign ( lhs, rhs) => {
265
267
// Make sure there are no remaining borrows for variables
266
268
// that are assigned over.
267
269
self . kill_borrows_on_place ( sets, lhs) ;
268
270
269
- if let mir:: Rvalue :: Ref ( _, _, ref place) = * * rhs {
271
+ if let box mir:: Rvalue :: Ref ( _, _, place) = rhs {
270
272
if place. ignore_borrow (
271
273
self . tcx ,
272
274
self . mir ,
@@ -285,7 +287,7 @@ impl<'a, 'gcx, 'tcx> BitDenotation<'tcx> for Borrows<'a, 'gcx, 'tcx> {
285
287
mir:: StatementKind :: StorageDead ( local) => {
286
288
// Make sure there are no remaining borrows for locals that
287
289
// are gone out of scope.
288
- self . kill_borrows_on_place ( sets, & Place :: Local ( local) ) ;
290
+ self . kill_borrows_on_place ( sets, & Place :: Local ( * local) ) ;
289
291
}
290
292
291
293
mir:: StatementKind :: InlineAsm { ref outputs, ref asm, .. } => {
0 commit comments