Skip to content

Commit 06f5ac8

Browse files
committed
fixup! mir-opt: Eliminate dead ref statements
Add a semicolon.
1 parent 6662f7d commit 06f5ac8

15 files changed

+38
-38
lines changed

compiler/rustc_middle/src/mir/pretty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,7 +779,7 @@ where
779779
for statement in &data.statements {
780780
extra_data(PassWhere::BeforeLocation(current_location), w)?;
781781
for debuginfo in statement.debuginfos.iter() {
782-
writeln!(w, "{INDENT}{INDENT}// DBG: {debuginfo:?}")?;
782+
writeln!(w, "{INDENT}{INDENT}// DBG: {debuginfo:?};")?;
783783
}
784784
let indented_body = format!("{INDENT}{INDENT}{statement:?};");
785785
if options.include_extra_comments {
@@ -816,7 +816,7 @@ where
816816
// Terminator at the bottom.
817817
extra_data(PassWhere::BeforeLocation(current_location), w)?;
818818
for debuginfo in data.after_last_stmt_debuginfos.iter() {
819-
writeln!(w, "{INDENT}{INDENT}// DBG: {debuginfo:?}")?;
819+
writeln!(w, "{INDENT}{INDENT}// DBG: {debuginfo:?};")?;
820820
}
821821
if data.terminator.is_some() {
822822
let indented_terminator = format!("{0}{0}{1:?};", INDENT, data.terminator().kind);

tests/mir-opt/dead-store-elimination/ref.dead_first.DeadStoreElimination-initial.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
bb0: {
1515
StorageLive(_2);
1616
- _2 = &((*_1).2: i32);
17-
+ // DBG: _2 = &((*_1).2: i32)
17+
+ // DBG: _2 = &((*_1).2: i32);
1818
StorageLive(_3);
1919
StorageLive(_4);
2020
_4 = &((*_1).0: i32);

tests/mir-opt/dead-store-elimination/ref.tuple.DeadStoreElimination-initial.diff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- StorageLive(_2);
1616
- _3 = deref_copy (_1.1: &Foo);
1717
- _2 = &((*_3).2: i32);
18-
+ // DBG: _2 = &((*_3).2: i32)
18+
+ // DBG: _2 = &((*_3).2: i32);
1919
_4 = deref_copy (_1.1: &Foo);
2020
_0 = copy ((*_4).0: i32);
2121
- StorageDead(_2);

tests/mir-opt/debuginfo/simplifycfg.drop_debuginfo.SimplifyCfg-final.diff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
- }
1414
-
1515
- bb1: {
16-
- // DBG: _3 = &((*_1).0: i32)
16+
- // DBG: _3 = &((*_1).0: i32);
1717
- goto -> bb2;
1818
- }
1919
-
2020
- bb2: {
21-
// DBG: _4 = &((*_1).1: i64)
21+
// DBG: _4 = &((*_1).1: i64);
2222
_0 = copy ((*_1).2: i32);
2323
return;
2424
}

tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_1.SimplifyCfg-final.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,14 @@
1616
-
1717
- bb1: {
1818
(*_2) = const true;
19-
// DBG: _3 = &((*_1).0: i32)
19+
// DBG: _3 = &((*_1).0: i32);
2020
- goto -> bb2;
2121
- }
2222
-
2323
- bb2: {
24-
// DBG: _4 = &((*_1).1: i64)
24+
// DBG: _4 = &((*_1).1: i64);
2525
_0 = copy ((*_1).2: i32);
26-
// DBG: _5 = &((*_1).2: i32)
26+
// DBG: _5 = &((*_1).2: i32);
2727
return;
2828
}
2929
}

tests/mir-opt/debuginfo/simplifycfg.preserve_debuginfo_2.SimplifyCfg-final.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
- }
1616
-
1717
- bb1: {
18-
// DBG: _2 = &((*_1).0: i32)
18+
// DBG: _2 = &((*_1).0: i32);
1919
- goto -> bb2;
2020
- }
2121
-
2222
- bb2: {
23-
// DBG: _3 = &((*_1).1: i64)
23+
// DBG: _3 = &((*_1).1: i64);
2424
_0 = copy ((*_1).2: i32);
25-
// DBG: _4 = &((*_1).2: i32)
25+
// DBG: _4 = &((*_1).2: i32);
2626
return;
2727
}
2828
}

tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-abort.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
}
3838

3939
bb2: {
40-
// DBG: _7 = &(*_2)[0 of 3]
41-
// DBG: _8 = &(*_2)[1 of 3]
42-
// DBG: _9 = &(*_2)[2 of 3]
40+
// DBG: _7 = &(*_2)[0 of 3];
41+
// DBG: _8 = &(*_2)[1 of 3];
42+
// DBG: _9 = &(*_2)[2 of 3];
4343
StorageDead(_4);
4444
return;
4545
}

tests/mir-opt/issue_76432.test.SimplifyComparisonIntegral.panic-unwind.diff

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
}
3838

3939
bb2: {
40-
// DBG: _7 = &(*_2)[0 of 3]
41-
// DBG: _8 = &(*_2)[1 of 3]
42-
// DBG: _9 = &(*_2)[2 of 3]
40+
// DBG: _7 = &(*_2)[0 of 3];
41+
// DBG: _8 = &(*_2)[1 of 3];
42+
// DBG: _9 = &(*_2)[2 of 3];
4343
StorageDead(_4);
4444
return;
4545
}

tests/mir-opt/pre-codegen/clone_as_copy.{impl#1}-clone.PreCodegen.after.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn <impl at $DIR/clone_as_copy.rs:12:10: 12:15>::clone(_1: &NestCopy) -> NestCop
99
}
1010

1111
bb0: {
12-
// DBG: _2 = &((*_1).1: AllCopy)
12+
// DBG: _2 = &((*_1).1: AllCopy);
1313
_0 = copy (*_1);
1414
return;
1515
}

tests/mir-opt/pre-codegen/loops.filter_mapped.PreCodegen.after.mir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn filter_mapped(_1: impl Iterator<Item = T>, _2: impl Fn(T) -> Option<U>) -> ()
3838

3939
bb2: {
4040
StorageLive(_7);
41-
// DBG: _11 = &_4
41+
// DBG: _11 = &_4;
4242
StorageLive(_5);
4343
_5 = &mut (_4.0: impl Iterator<Item = T>);
4444
StorageLive(_6);

0 commit comments

Comments
 (0)