about summary refs log tree commit diff
path: root/compiler/rustc_interface/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-08-03 14:11:31 -0400
committerMichael Goulet <michael@errs.io>2024-08-08 17:57:31 -0400
commit524e7689a9a98e0d3769fac4b3567dbbbf4b5d78 (patch)
tree977efcb70a8f94ab55da2bf5964b5770fd90eb02 /compiler/rustc_interface/src
parent3e9bd8b566a47c5d1c1dbc7e043b4b7fa5330eca (diff)
downloadrust-524e7689a9a98e0d3769fac4b3567dbbbf4b5d78.tar.gz
rust-524e7689a9a98e0d3769fac4b3567dbbbf4b5d78.zip
Add comment that bors did not see pushed before it merged
Diffstat (limited to 'compiler/rustc_interface/src')
-rw-r--r--compiler/rustc_interface/src/passes.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 023352156eb..96a6f52d60b 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -818,8 +818,14 @@ fn run_required_analyses(tcx: TyCtxt<'_>) {
     });
     sess.time("layout_testing", || layout_test::test_layout(tcx));
     sess.time("abi_testing", || abi_test::test_abi(tcx));
+
+    // If `-Zvalidate-mir` is set, we also want to compute the final MIR for each item
+    // (either its `mir_for_ctfe` or `optimized_mir`) since that helps uncover any bugs
+    // in MIR optimizations that may only be reachable through codegen, or other codepaths
+    // that requires the optimized/ctfe MIR, such as polymorphization, coroutine bodies,
+    // or evaluating consts.
     if tcx.sess.opts.unstable_opts.validate_mir {
-        sess.time("ensuring_optimized_MIR_is_computable", || {
+        sess.time("ensuring_final_MIR_is_computable", || {
             tcx.hir().par_body_owners(|def_id| {
                 tcx.instance_mir(ty::InstanceKind::Item(def_id.into()));
             });