about summary refs log tree commit diff
path: root/compiler/rustc_interface
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-24 18:20:15 +0200
committerGitHub <noreply@github.com>2022-08-24 18:20:15 +0200
commit8cdf4080c19097ff3fb4e39bb654dd41f61caa24 (patch)
tree112b0ece47a090afa39f0b7f8b0bb70ff490ce59 /compiler/rustc_interface
parentecf14d459caa6f8e274b33c829ded0d34662839b (diff)
parentf280138c7c99c3a9bebbdf719f716c43eb944bbd (diff)
downloadrust-8cdf4080c19097ff3fb4e39bb654dd41f61caa24.tar.gz
rust-8cdf4080c19097ff3fb4e39bb654dd41f61caa24.zip
Rollup merge of #100919 - sanxiyn:parallel-liveness, r=oli-obk
Use par_body_owners for liveness

I did this refactoring while working on something else. Liveness is about bodies, there is no reason to use par_for_each_module here.

Tests are updated because things are visited in a different order. I checked diagnostics are same, just in a different (and IMO, better) order.
Diffstat (limited to 'compiler/rustc_interface')
-rw-r--r--compiler/rustc_interface/src/passes.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_interface/src/passes.rs b/compiler/rustc_interface/src/passes.rs
index 014cf88389e..b7fbda58eca 100644
--- a/compiler/rustc_interface/src/passes.rs
+++ b/compiler/rustc_interface/src/passes.rs
@@ -911,13 +911,13 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
                 });
             },
             {
-                sess.time("liveness_and_intrinsic_checking", || {
-                    tcx.hir().par_for_each_module(|module| {
+                sess.time("liveness_checking", || {
+                    tcx.hir().par_body_owners(|def_id| {
                         // this must run before MIR dump, because
                         // "not all control paths return a value" is reported here.
                         //
                         // maybe move the check to a MIR pass?
-                        tcx.ensure().check_mod_liveness(module);
+                        tcx.ensure().check_liveness(def_id.to_def_id());
                     });
                 });
             }