Skip to content

Commit acc150b

Browse files
validate: skip debuginfo
1 parent c1a431e commit acc150b

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

compiler/rustc_mir/src/transform/validate.rs

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,17 @@
11
//! Validates the MIR to ensure that invariants are upheld.
22
3-
use crate::{
4-
dataflow::impls::MaybeStorageLive, dataflow::Analysis, dataflow::ResultsCursor,
5-
util::storage::AlwaysLiveLocals,
6-
};
3+
use crate::dataflow::impls::MaybeStorageLive;
4+
use crate::dataflow::{Analysis, ResultsCursor};
5+
use crate::util::storage::AlwaysLiveLocals;
76

87
use super::{MirPass, MirSource};
9-
use rustc_middle::mir::{visit::PlaceContext, visit::Visitor, Local};
10-
use rustc_middle::{
11-
mir::{
12-
AggregateKind, BasicBlock, Body, BorrowKind, Location, MirPhase, Operand, Rvalue,
13-
Statement, StatementKind, Terminator, TerminatorKind,
14-
},
15-
ty::{
16-
self,
17-
relate::{Relate, RelateResult, TypeRelation},
18-
ParamEnv, Ty, TyCtxt,
19-
},
8+
use rustc_middle::mir::visit::{PlaceContext, Visitor};
9+
use rustc_middle::mir::{
10+
AggregateKind, BasicBlock, Body, BorrowKind, Local, Location, MirPhase, Operand, Rvalue,
11+
Statement, StatementKind, Terminator, TerminatorKind, VarDebugInfo,
2012
};
13+
use rustc_middle::ty::relate::{Relate, RelateResult, TypeRelation};
14+
use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt};
2115

2216
#[derive(Copy, Clone, Debug)]
2317
enum EdgeKind {
@@ -236,6 +230,11 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
236230
}
237231
}
238232

233+
fn visit_var_debug_info(&mut self, _var_debug_info: &VarDebugInfo<'tcx>) {
234+
// Debuginfo can contain field projections, which count as a use of the base local. Skip
235+
// debuginfo so that we avoid the storage liveness assertion in that case.
236+
}
237+
239238
fn visit_operand(&mut self, operand: &Operand<'tcx>, location: Location) {
240239
// `Operand::Copy` is only supposed to be used with `Copy` types.
241240
if let Operand::Copy(place) = operand {

0 commit comments

Comments
 (0)