Skip to content
Permalink
Browse files

rustc_mir: don't rely on mir::LocalDecl `visibility_scope`s in the MI…

…R borrowck.
  • Loading branch information...
eddyb committed Nov 27, 2018
1 parent 1525dc2 commit d20da130182054f374411fd476b19e8aa56a1c4b
Showing with 1 addition and 5 deletions.
  1. +1 −5 src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs
@@ -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;

0 comments on commit d20da13

Please sign in to comment.
You can’t perform that action at this time.