diff options
| author | Camelid <camelidcamel@gmail.com> | 2020-11-22 17:33:06 -0800 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2020-11-22 17:39:15 -0800 |
| commit | b196bec2362b1e17b15635da12cea173315e2b8c (patch) | |
| tree | 15152b483547f9601b03a82e84b70f2a33600945 /compiler | |
| parent | f7bf282d9be6a0917f950e83f1856e1c5ede1a33 (diff) | |
| download | rust-b196bec2362b1e17b15635da12cea173315e2b8c.tar.gz rust-b196bec2362b1e17b15635da12cea173315e2b8c.zip | |
Add comment and remove obsolete special case
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_middle/src/mir/visit.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_mir/src/transform/validate.rs | 8 |
2 files changed, 2 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index e9a27c82af2..a470c454785 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -1018,6 +1018,7 @@ macro_rules! visit_place_fns { if !place.projection.is_empty() { if context.is_use() { + // ^ Only change the context if it is a real use, not a "use" in debuginfo. context = if context.is_mutating_use() { PlaceContext::MutatingUse(MutatingUseContext::Projection) } else { diff --git a/compiler/rustc_mir/src/transform/validate.rs b/compiler/rustc_mir/src/transform/validate.rs index 75399e9c32c..037c446d82f 100644 --- a/compiler/rustc_mir/src/transform/validate.rs +++ b/compiler/rustc_mir/src/transform/validate.rs @@ -12,7 +12,7 @@ use rustc_middle::mir::traversal; use rustc_middle::mir::visit::{PlaceContext, Visitor}; use rustc_middle::mir::{ AggregateKind, BasicBlock, Body, BorrowKind, Local, Location, MirPhase, Operand, PlaceRef, - Rvalue, SourceScope, Statement, StatementKind, Terminator, TerminatorKind, VarDebugInfo, + Rvalue, SourceScope, Statement, StatementKind, Terminator, TerminatorKind, }; use rustc_middle::ty::fold::BottomUpFolder; use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt, TypeFoldable}; @@ -198,12 +198,6 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { } } - fn visit_var_debug_info(&mut self, var_debug_info: &VarDebugInfo<'tcx>) { - // Debuginfo can contain field projections, which count as a use of the base local. Skip - // debuginfo so that we avoid the storage liveness assertion in that case. - self.visit_source_info(&var_debug_info.source_info); - } - fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location) { // This check is somewhat expensive, so only run it when -Zvalidate-mir is passed. if self.tcx.sess.opts.debugging_opts.validate_mir { |
