Skip to content

Commit 1b2f8b2

Browse files
committed
fix more tests
1 parent 3f3c389 commit 1b2f8b2

12 files changed

+37
-20
lines changed

compiler/rustc_mir_transform/src/pass_manager.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,10 @@ fn run_passes_inner<'tcx>(
252252

253253
let validate =
254254
(validate_each & tcx.sess.opts.unstable_opts.validate_mir & !body.should_skip())
255-
|| new_phase == MirPhase::Runtime(RuntimePhase::Optimized);
255+
|| matches!(
256+
new_phase,
257+
MirPhase::Runtime(RuntimePhase::Optimized | RuntimePhase::Codegen)
258+
);
256259
let lint = tcx.sess.opts.unstable_opts.lint_mir & !body.should_skip();
257260
if validate {
258261
validate_body(tcx, body, format!("after phase change to {}", new_phase.name()));

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
StorageDead(_7);
5555
StorageLive(_11);
5656
StorageLive(_8);
57-
_8 = UbChecks();
58-
switchInt(move _8) -> [0: bb4, otherwise: bb2];
57+
_8 = const false;
58+
switchInt(const false) -> [0: bb4, otherwise: bb2];
5959
}
6060

6161
bb1: {

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
StorageDead(_7);
5555
StorageLive(_11);
5656
StorageLive(_8);
57-
_8 = UbChecks();
58-
switchInt(move _8) -> [0: bb5, otherwise: bb3];
57+
_8 = const false;
58+
switchInt(const false) -> [0: bb5, otherwise: bb3];
5959
}
6060

6161
bb1: {

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
StorageDead(_7);
5555
StorageLive(_11);
5656
StorageLive(_8);
57-
_8 = UbChecks();
58-
switchInt(move _8) -> [0: bb4, otherwise: bb2];
57+
_8 = const false;
58+
switchInt(const false) -> [0: bb4, otherwise: bb2];
5959
}
6060

6161
bb1: {

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-unwind.diff

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
StorageDead(_7);
5555
StorageLive(_11);
5656
StorageLive(_8);
57-
_8 = UbChecks();
58-
switchInt(move _8) -> [0: bb5, otherwise: bb3];
57+
_8 = const false;
58+
switchInt(const false) -> [0: bb5, otherwise: bb3];
5959
}
6060

6161
bb1: {

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-abort.diff

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
StorageDead(_7);
5757
StorageLive(_11);
5858
StorageLive(_8);
59-
_8 = UbChecks();
60-
switchInt(move _8) -> [0: bb4, otherwise: bb2];
59+
- _8 = UbChecks();
60+
- switchInt(move _8) -> [0: bb4, otherwise: bb2];
61+
+ _8 = const false;
62+
+ switchInt(const false) -> [0: bb4, otherwise: bb2];
6163
}
6264

6365
bb1: {

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.32bit.panic-unwind.diff

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
StorageDead(_7);
5757
StorageLive(_11);
5858
StorageLive(_8);
59-
_8 = UbChecks();
60-
switchInt(move _8) -> [0: bb5, otherwise: bb3];
59+
- _8 = UbChecks();
60+
- switchInt(move _8) -> [0: bb5, otherwise: bb3];
61+
+ _8 = const false;
62+
+ switchInt(const false) -> [0: bb5, otherwise: bb3];
6163
}
6264

6365
bb1: {

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-abort.diff

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
StorageDead(_7);
5757
StorageLive(_11);
5858
StorageLive(_8);
59-
_8 = UbChecks();
60-
switchInt(move _8) -> [0: bb4, otherwise: bb2];
59+
- _8 = UbChecks();
60+
- switchInt(move _8) -> [0: bb4, otherwise: bb2];
61+
+ _8 = const false;
62+
+ switchInt(const false) -> [0: bb4, otherwise: bb2];
6163
}
6264

6365
bb1: {

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.GVN.64bit.panic-unwind.diff

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
StorageDead(_7);
5757
StorageLive(_11);
5858
StorageLive(_8);
59-
_8 = UbChecks();
60-
switchInt(move _8) -> [0: bb5, otherwise: bb3];
59+
- _8 = UbChecks();
60+
- switchInt(move _8) -> [0: bb5, otherwise: bb3];
61+
+ _8 = const false;
62+
+ switchInt(const false) -> [0: bb5, otherwise: bb3];
6163
}
6264

6365
bb1: {

tests/ui/mir/validate/critical-edge.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use std::intrinsics::mir::*;
1111

1212
#[custom_mir(dialect = "runtime", phase = "codegen")]
13-
#[inline]
13+
#[inline(never)] // Force codegen so we go through codegen MIR validation
1414
pub fn f(a: u32) -> u32 {
1515
mir! {
1616
{
@@ -29,5 +29,3 @@ pub fn f(a: u32) -> u32 {
2929
}
3030
}
3131
}
32-
33-
pub static F: fn(u32) -> u32 = f;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
WARN rustc_codegen_ssa::mir::locals Unexpected initial operand type:
2+
expected Closure(DefId(0:9 ~ issue_74614[b919]::outer::{closure#0}), [Closure(DefId(0:9 ~ issue_74614[b919]::outer::{closure#0}), [T/#0, i8, Binder { value: extern "RustCall" fn(()), bound_vars: [] }, ()]), i8, Binder { value: extern "RustCall" fn(()), bound_vars: [] }, ()]),
3+
found Closure(DefId(0:9 ~ issue_74614[b919]::outer::{closure#0}), [T/#0, i8, Binder { value: extern "RustCall" fn(()), bound_vars: [] }, ()]).
4+
See <https://github.com/rust-lang/rust/issues/114858>.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
WARN rustc_codegen_ssa::mir::locals Unexpected initial operand type:
2+
expected Closure(DefId(0:8 ~ issue_74636[7d87]::outer::{closure#0}), [Closure(DefId(0:8 ~ issue_74636[7d87]::outer::{closure#0}), [T/#0, i8, Binder { value: extern "RustCall" fn(()), bound_vars: [] }, ()]), i8, Binder { value: extern "RustCall" fn(()), bound_vars: [] }, ()]),
3+
found Closure(DefId(0:8 ~ issue_74636[7d87]::outer::{closure#0}), [T/#0, i8, Binder { value: extern "RustCall" fn(()), bound_vars: [] }, ()]).
4+
See <https://github.com/rust-lang/rust/issues/114858>.

0 commit comments

Comments
 (0)