Skip to content

Commit bfb8ab6

Browse files
Make validate_mir pull optimized MIR for all bodies
1 parent a604303 commit bfb8ab6

File tree

7 files changed

+11
-6
lines changed

7 files changed

+11
-6
lines changed

compiler/rustc_interface/src/passes.rs

+5
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,11 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
818818
});
819819
sess.time("layout_testing", || layout_test::test_layout(tcx));
820820
sess.time("abi_testing", || abi_test::test_abi(tcx));
821+
if tcx.sess.opts.unstable_opts.validate_mir {
822+
tcx.hir().par_body_owners(|def_id| {
823+
tcx.ensure().optimized_mir(def_id);
824+
});
825+
}
821826
}
822827

823828
/// Runs the type-checking, region checking and other miscellaneous analysis

tests/crashes/105249.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ trait Bar: for<'a> Foo<&'a ()> { }
1212
impl Bar for () {}
1313

1414
fn main() {
15-
(&() as &dyn Bar).print(); // Segfault
15+
(&() as &dyn Bar).print();
1616
}

tests/crashes/121127.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: #121127
2-
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes -C debuginfo=2
2+
//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes -C debuginfo=2
33
// Note that as of PR#123949 this only crashes with debuginfo enabled
44

55
#![feature(specialization)]

tests/crashes/122909.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
1+
//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
22
//@ known-bug: #122909
33

44

tests/crashes/123893.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: #123893
2-
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes -Zinline-mir-threshold=20
2+
//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes -Zinline-mir-threshold=20
33
pub fn main() {
44
generic_impl::<bool>();
55
}

tests/crashes/124436.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: rust-lang/rust#124436
2-
//@ compile-flags: -Zdump-mir=all -Zpolymorphize=on
2+
//@ compile-flags: -Zvalidate-mir
33

44
pub trait TraitCat {}
55
pub trait TraitDog {}

tests/crashes/126896.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ known-bug: rust-lang/rust#126896
2-
//@ compile-flags: -Zpolymorphize=on -Zinline-mir=yes
2+
//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
33

44
#![feature(type_alias_impl_trait)]
55
type Two<'a, 'b> = impl std::fmt::Debug;

0 commit comments

Comments
 (0)