diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2025-01-19 01:22:39 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-19 01:22:39 +0100 |
| commit | c87dd96cf5ef661747d7a940ad6f645662fac60d (patch) | |
| tree | dbe3ae7dbcfd4ba8c057dc1dcbd799feed236c15 /compiler/rustc_interface/src | |
| parent | e28e2b801efa9dda16f1fb6a33756bdc4b12d04c (diff) | |
| parent | 0e98d9a3f78205a8135093ef3caa93ac604561de (diff) | |
| download | rust-c87dd96cf5ef661747d7a940ad6f645662fac60d.tar.gz rust-c87dd96cf5ef661747d7a940ad6f645662fac60d.zip | |
Rollup merge of #135708 - compiler-errors:compiler-nits, r=lqd
Some random compiler nits The only "observable" change here is using `par_body_owners` for coroutine witnesses/coroutine obligation checking. r? lqd (or reassign, you just seem to like to approve prs :3 )
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index aff66e48fbb..241bc35857a 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -875,6 +875,8 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { }); // Freeze definitions as we don't add new ones at this point. // We need to wait until now since we synthesize a by-move body + // for all coroutine-closures. + // // This improves performance by allowing lock-free access to them. tcx.untracked().definitions.freeze(); @@ -887,7 +889,7 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { }); }); sess.time("MIR_effect_checking", || { - for def_id in tcx.hir().body_owners() { + tcx.hir().par_body_owners(|def_id| { tcx.ensure().has_ffi_unwind_calls(def_id); // If we need to codegen, ensure that we emit all errors from @@ -898,15 +900,17 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { { tcx.ensure().mir_drops_elaborated_and_const_checked(def_id); } - } + }); }); - tcx.hir().par_body_owners(|def_id| { - if tcx.is_coroutine(def_id.to_def_id()) { - tcx.ensure().mir_coroutine_witnesses(def_id); - tcx.ensure().check_coroutine_obligations( - tcx.typeck_root_def_id(def_id.to_def_id()).expect_local(), - ); - } + sess.time("coroutine_obligations", || { + tcx.hir().par_body_owners(|def_id| { + if tcx.is_coroutine(def_id.to_def_id()) { + tcx.ensure().mir_coroutine_witnesses(def_id); + tcx.ensure().check_coroutine_obligations( + tcx.typeck_root_def_id(def_id.to_def_id()).expect_local(), + ); + } + }); }); sess.time("layout_testing", || layout_test::test_layout(tcx)); |
