about summary refs log tree commit diff
path: root/compiler/rustc_data_structures/src/sync.rs
diff options
context:
space:
mode:
authorSparrowLii <liyuan179@huawei.com>2023-03-14 20:31:58 +0800
committerSparrowLii <liyuan179@huawei.com>2023-05-06 09:34:22 +0800
commitf196e27d87cf2be019098c7562b4c2cf26566680 (patch)
tree62fa0d47970025b9059803363c6c87252b511c65 /compiler/rustc_data_structures/src/sync.rs
parent261b727d7626506f0eabb88e99c9d6a27b2a4f24 (diff)
downloadrust-f196e27d87cf2be019098c7562b4c2cf26566680.tar.gz
rust-f196e27d87cf2be019098c7562b4c2cf26566680.zip
fix `parallel!`
Diffstat (limited to 'compiler/rustc_data_structures/src/sync.rs')
-rw-r--r--compiler/rustc_data_structures/src/sync.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_data_structures/src/sync.rs b/compiler/rustc_data_structures/src/sync.rs
index bffb98630c8..f30235572d0 100644
--- a/compiler/rustc_data_structures/src/sync.rs
+++ b/compiler/rustc_data_structures/src/sync.rs
@@ -402,6 +402,13 @@ cfg_if! {
                     // We catch panics here ensuring that all the blocks execute.
                     // This makes behavior consistent with the parallel compiler.
                     let mut panic = None;
+                    if let Err(p) = ::std::panic::catch_unwind(
+                        ::std::panic::AssertUnwindSafe(|| $fblock)
+                    ) {
+                        if panic.is_none() {
+                            panic = Some(p);
+                        }
+                    }
                     $(
                         if let Err(p) = ::std::panic::catch_unwind(
                             ::std::panic::AssertUnwindSafe(|| $blocks)