Skip to content

Commit d1cb5da

Browse files
committed
Move some other passes into a parallel block
1 parent 7b6eb2a commit d1cb5da

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

compiler/rustc_interface/src/passes.rs

+26-23
Original file line numberDiff line numberDiff line change
@@ -805,29 +805,35 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
805805
sess.time("MIR_borrow_checking", || {
806806
tcx.hir().par_body_owners(|def_id| tcx.ensure().mir_borrowck(def_id));
807807
});
808+
},
809+
{
810+
sess.time("MIR_effect_checking", || {
811+
for def_id in tcx.hir().body_owners() {
812+
tcx.ensure().thir_check_unsafety(def_id);
813+
if !tcx.sess.opts.unstable_opts.thir_unsafeck {
814+
rustc_mir_transform::check_unsafety::check_unsafety(tcx, def_id);
815+
}
816+
tcx.ensure().has_ffi_unwind_calls(def_id);
817+
818+
// If we need to codegen, ensure that we emit all errors from
819+
// `mir_drops_elaborated_and_const_checked` now, to avoid discovering
820+
// them later during codegen.
821+
if tcx.sess.opts.output_types.should_codegen()
822+
|| tcx.hir().body_const_context(def_id).is_some()
823+
{
824+
tcx.ensure().mir_drops_elaborated_and_const_checked(def_id);
825+
tcx.ensure()
826+
.unused_generic_params(ty::InstanceDef::Item(def_id.to_def_id()));
827+
}
828+
}
829+
});
830+
},
831+
{
832+
sess.time("layout_testing", || layout_test::test_layout(tcx));
833+
sess.time("abi_testing", || abi_test::test_abi(tcx));
808834
}
809835
);
810836

811-
sess.time("MIR_effect_checking", || {
812-
for def_id in tcx.hir().body_owners() {
813-
tcx.ensure().thir_check_unsafety(def_id);
814-
if !tcx.sess.opts.unstable_opts.thir_unsafeck {
815-
rustc_mir_transform::check_unsafety::check_unsafety(tcx, def_id);
816-
}
817-
tcx.ensure().has_ffi_unwind_calls(def_id);
818-
819-
// If we need to codegen, ensure that we emit all errors from
820-
// `mir_drops_elaborated_and_const_checked` now, to avoid discovering
821-
// them later during codegen.
822-
if tcx.sess.opts.output_types.should_codegen()
823-
|| tcx.hir().body_const_context(def_id).is_some()
824-
{
825-
tcx.ensure().mir_drops_elaborated_and_const_checked(def_id);
826-
tcx.ensure().unused_generic_params(ty::InstanceDef::Item(def_id.to_def_id()));
827-
}
828-
}
829-
});
830-
831837
if tcx.sess.opts.unstable_opts.drop_tracking_mir {
832838
tcx.hir().par_body_owners(|def_id| {
833839
if let rustc_hir::def::DefKind::Generator = tcx.def_kind(def_id) {
@@ -837,9 +843,6 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
837843
});
838844
}
839845

840-
sess.time("layout_testing", || layout_test::test_layout(tcx));
841-
sess.time("abi_testing", || abi_test::test_abi(tcx));
842-
843846
// Avoid overwhelming user with errors if borrow checking failed.
844847
// I'm not sure how helpful this is, to be honest, but it avoids a
845848
// lot of annoying errors in the ui tests (basically,

0 commit comments

Comments
 (0)