From d20da130182054f374411fd476b19e8aa56a1c4b Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Tue, 27 Nov 2018 05:19:07 +0200 Subject: [PATCH] rustc_mir: don't rely on mir::LocalDecl `visibility_scope`s in the MIR borrowck. --- src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs b/src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs index 0430ad307ce..89f85a941d3 100644 --- a/src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs +++ b/src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs @@ -273,11 +273,7 @@ pub(in crate::borrow_check) fn explain_why_borrow_contains_point( 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;