Skip to content

Commit 53e604c

Browse files
csmoespastorino
authored andcommitted
rewrite place in used_muts into neo_place
1 parent 7af3ddd commit 53e604c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/librustc_mir/borrow_check/used_muts.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use rustc::mir::visit::{PlaceContext, Visitor};
2-
use rustc::mir::{BasicBlock, Local, Location, Place, Statement, StatementKind, TerminatorKind};
2+
use rustc::mir::{BasicBlock, Local, Location, Statement, StatementKind, TerminatorKind};
3+
use rustc::mir::PlaceBase;
34

45
use rustc_data_structures::fx::FxHashSet;
56

@@ -114,8 +115,9 @@ impl<'visit, 'cx, 'gcx, 'tcx> Visitor<'tcx> for GatherUsedMutsVisitor<'visit, 'c
114115
"assignment of {:?} to {:?}, adding {:?} to used mutable set",
115116
path.place, local, path.place
116117
);
117-
if let Place::Local(user_local) = path.place {
118-
self.mbcx.used_mut.insert(user_local);
118+
let neo_place = self.mbcx.infcx.tcx.as_new_place(&path.place);
119+
if let Some(PlaceBase::Local(user_local)) = neo_place.as_place_base() {
120+
self.mbcx.used_mut.insert(*user_local);
119121
}
120122
}
121123
}

0 commit comments

Comments
 (0)