Skip to content

Commit e14f065

Browse files
committed
mir: Introduce an empty StmtDebugInfo
1 parent 90e0835 commit e14f065

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
11621162
let opt_assignment_rhs_span =
11631163
self.find_assignments(local).first().map(|&location| {
11641164
if let Some(mir::Statement {
1165-
source_info: _,
11661165
kind:
11671166
mir::StatementKind::Assign(box (
11681167
_,

compiler/rustc_middle/src/mir/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1710,7 +1710,7 @@ mod size_asserts {
17101710
static_assert_size!(BasicBlockData<'_>, 128);
17111711
static_assert_size!(LocalDecl<'_>, 40);
17121712
static_assert_size!(SourceScopeData<'_>, 64);
1713-
static_assert_size!(Statement<'_>, 32);
1713+
static_assert_size!(Statement<'_>, 56);
17141714
static_assert_size!(Terminator<'_>, 96);
17151715
static_assert_size!(VarDebugInfo<'_>, 88);
17161716
// tidy-alphabetical-end

compiler/rustc_middle/src/mir/statement.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,19 @@ use crate::ty::CoroutineArgsExt;
1515
pub struct Statement<'tcx> {
1616
pub source_info: SourceInfo,
1717
pub kind: StatementKind<'tcx>,
18+
pub debug_info: Vec<StmtDebugInfo>,
1819
}
1920

2021
impl<'tcx> Statement<'tcx> {
2122
/// Changes a statement to a nop. This is both faster than deleting instructions and avoids
2223
/// invalidating statement indices in `Location`s.
2324
pub fn make_nop(&mut self) {
25+
// TODO: convert the stmt to debuginfo.
2426
self.kind = StatementKind::Nop
2527
}
2628

2729
pub fn new(source_info: SourceInfo, kind: StatementKind<'tcx>) -> Self {
28-
Statement { source_info, kind }
30+
Statement { source_info, kind, debug_info: Vec::new() }
2931
}
3032
}
3133

@@ -939,3 +941,6 @@ impl RawPtrKind {
939941
}
940942
}
941943
}
944+
945+
#[derive(Debug, Clone, TyEncodable, TyDecodable, HashStable, TypeFoldable, TypeVisitable)]
946+
pub struct StmtDebugInfo {}

compiler/rustc_middle/src/mir/visit.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ macro_rules! make_mir_visitor {
381381
statement: & $($mutability)? Statement<'tcx>,
382382
location: Location
383383
) {
384-
let Statement { source_info, kind } = statement;
384+
// TODO: visit debuginfo
385+
let Statement { source_info, kind, .. } = statement;
385386

386387
self.visit_source_info(source_info);
387388
match kind {

0 commit comments

Comments
 (0)