diff options
| author | Michael Goulet <michael@errs.io> | 2024-08-01 13:05:17 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-08-26 18:44:19 -0400 |
| commit | 4609841c078cde37c0e2ffb481059cb1bd330233 (patch) | |
| tree | a0dd66a30e8cb09c5a1a75d08a0e7e870ddc1aab /compiler/rustc_interface/src | |
| parent | 515395af0efdbdd657ff08a1f6d28e553856654f (diff) | |
| download | rust-4609841c078cde37c0e2ffb481059cb1bd330233.tar.gz rust-4609841c078cde37c0e2ffb481059cb1bd330233.zip | |
Stop using a special inner body for the coroutine by-move body for async closures
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 96a6f52d60b..2a4367965ee 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -784,7 +784,22 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { } ); }); + rustc_hir_analysis::check_crate(tcx); + sess.time("MIR_coroutine_by_move_body", || { + tcx.hir().par_body_owners(|def_id| { + if tcx.needs_coroutine_by_move_body_def_id(def_id) { + tcx.ensure_with_value().coroutine_by_move_body_def_id(def_id); + } + }); + }); + // 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 + // This improves performance by allowing lock-free access to them. + // FIXME(async_closures): We could force `coroutine_by_move_body_def_id` + // immediately after typeck, then freeze after that. + tcx.untracked().definitions.freeze(); + sess.time("MIR_borrow_checking", || { tcx.hir().par_body_owners(|def_id| { // Run unsafety check because it's responsible for stealing and @@ -816,6 +831,7 @@ fn run_required_analyses(tcx: TyCtxt<'_>) { ); } }); + sess.time("layout_testing", || layout_test::test_layout(tcx)); sess.time("abi_testing", || abi_test::test_abi(tcx)); |
