Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
rustc_mir: don't rely on mir::LocalDecl visibility_scopes in the MI…
…R borrowck.
  • Loading branch information
eddyb committed Apr 23, 2019
1 parent 1525dc2 commit d20da13
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs
Expand Up @@ -273,11 +273,7 @@ impl<'cx, 'gcx, 'tcx> MirBorrowckCtxt<'cx, 'gcx, 'tcx> {
if mir.local_decls[local].name.is_some() {
if let Some((WriteKind::StorageDeadOrDrop, place)) = kind_place {
if let Place::Base(PlaceBase::Local(borrowed_local)) = place {
let dropped_local_scope = mir.local_decls[local].visibility_scope;
let borrowed_local_scope =
mir.local_decls[*borrowed_local].visibility_scope;

if mir.is_sub_scope(borrowed_local_scope, dropped_local_scope)
if mir.local_decls[*borrowed_local].name.is_some()
&& local != *borrowed_local
{
should_note_order = true;
Expand Down

0 comments on commit d20da13

Please sign in to comment.