diff options
| author | SparrowLii <liyuan179@huawei.com> | 2023-03-14 20:31:58 +0800 |
|---|---|---|
| committer | SparrowLii <liyuan179@huawei.com> | 2023-05-06 09:34:22 +0800 |
| commit | f196e27d87cf2be019098c7562b4c2cf26566680 (patch) | |
| tree | 62fa0d47970025b9059803363c6c87252b511c65 /compiler/rustc_data_structures/src/sync.rs | |
| parent | 261b727d7626506f0eabb88e99c9d6a27b2a4f24 (diff) | |
| download | rust-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.rs | 7 |
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) |
