diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-07-19 13:30:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-19 13:30:52 +0200 |
| commit | e6904fc5b24a10e97d0a32908f49886e52e73990 (patch) | |
| tree | 1447d09895921da9f27af3f9bbcfee41a11e4b2a /compiler/rustc_middle/src | |
| parent | ae90a8f2e148f1fd1e0e907912d274224215cb12 (diff) | |
| parent | e2ecb68a0eeee6db4d8f605374e656822186f8b4 (diff) | |
Rollup merge of #99457 - SparrowLii:para_iter, r=fee1-dead
use `par_for_each_in` in `par_body_owners` and `collect_crate_mono_items`
Using `par_iter` in non-parallel mode will cause the entire process to abort when any iteration panics. So we can use `par_for_each_in` instead to make the error message consistent with parallel mode. This means that the compiler will output more error messages in some cases. This fixes the following ui tests when set `parallel-compiler = true`:
```
[ui] src/test\ui\privacy\privacy2.rs
[ui] src/test\ui\privacy\privacy3.rs
[ui] src/test\ui\type_length_limit.rs
```
This refers to #68171
Updates #75760
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/hir/map/mod.rs | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_middle/src/hir/map/mod.rs b/compiler/rustc_middle/src/hir/map/mod.rs index 3a59b2069b3..0001e1aa53e 100644 --- a/compiler/rustc_middle/src/hir/map/mod.rs +++ b/compiler/rustc_middle/src/hir/map/mod.rs @@ -491,9 +491,7 @@ impl<'hir> Map<'hir> { } pub fn par_body_owners<F: Fn(LocalDefId) + Sync + Send>(self, f: F) { - use rustc_data_structures::sync::{par_iter, ParallelIterator}; - - par_iter(&self.tcx.hir_crate_items(()).body_owners[..]).for_each(|&def_id| f(def_id)); + par_for_each_in(&self.tcx.hir_crate_items(()).body_owners[..], |&def_id| f(def_id)); } pub fn ty_param_owner(self, def_id: LocalDefId) -> LocalDefId { |
