diff options
| author | bors <bors@rust-lang.org> | 2024-03-14 02:54:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-03-14 02:54:10 +0000 |
| commit | 5ac0b2d0219de2fd6fef86c69ef0cfa1e6c36f3b (patch) | |
| tree | 093ee4994478e32a433204b49a338b5b289de445 /compiler/rustc_interface | |
| parent | c7fed9f85422696f67fcf76abc846827fd4dde72 (diff) | |
| parent | 96d24f2dd13e8e9d0c6f9912781ffe1fc79864d3 (diff) | |
| download | rust-5ac0b2d0219de2fd6fef86c69ef0cfa1e6c36f3b.tar.gz rust-5ac0b2d0219de2fd6fef86c69ef0cfa1e6c36f3b.zip | |
Auto merge of #122347 - oli-obk:track_errors13, r=compiler-errors
Revert "Auto merge of #122140 - oli-obk:track_errors13, r=davidtwco" This reverts commit 65cd843ae06ad00123c131a431ed5304e4cd577a, reversing changes made to d255c6a57c393db6221b1ff700daea478436f1cd. reverts https://github.com/rust-lang/rust/pull/122140 It was a large regression in wall time due to trashing CPU caches
Diffstat (limited to 'compiler/rustc_interface')
| -rw-r--r-- | compiler/rustc_interface/src/passes.rs | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs index 4cc9ffdbb2f..4b4c1d6cf67 100644 --- a/compiler/rustc_interface/src/passes.rs +++ b/compiler/rustc_interface/src/passes.rs @@ -734,22 +734,19 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { }); // passes are timed inside typeck - rustc_hir_analysis::check_crate(tcx); + rustc_hir_analysis::check_crate(tcx)?; - sess.time("typeck_and_mir_analyses", || { + sess.time("MIR_borrow_checking", || { tcx.hir().par_body_owners(|def_id| { - let def_kind = tcx.def_kind(def_id); - // FIXME: Remove this when we implement creating `DefId`s - // for anon constants during their parents' typeck. - // Typeck all body owners in parallel will produce queries - // cycle errors because it may typeck on anon constants directly. - if !matches!(def_kind, rustc_hir::def::DefKind::AnonConst) { - tcx.ensure().typeck(def_id); - } // Run unsafety check because it's responsible for stealing and // deallocating THIR. tcx.ensure().check_unsafety(def_id); - tcx.ensure().mir_borrowck(def_id); + tcx.ensure().mir_borrowck(def_id) + }); + }); + + sess.time("MIR_effect_checking", || { + for def_id in tcx.hir().body_owners() { if !tcx.sess.opts.unstable_opts.thir_unsafeck { rustc_mir_transform::check_unsafety::check_unsafety(tcx, def_id); } @@ -764,15 +761,15 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { tcx.ensure().mir_drops_elaborated_and_const_checked(def_id); tcx.ensure().unused_generic_params(ty::InstanceDef::Item(def_id.to_def_id())); } - - if tcx.is_coroutine(def_id.to_def_id()) { - tcx.ensure().mir_coroutine_witnesses(def_id); - tcx.ensure().check_coroutine_obligations(def_id); - } - }) + } }); - tcx.ensure().check_unused_traits(()); + 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(def_id); + } + }); sess.time("layout_testing", || layout_test::test_layout(tcx)); sess.time("abi_testing", || abi_test::test_abi(tcx)); |
