Skip to content

Commit 7de1a1f

Browse files
committed
Auto merge of rust-lang#122218 - Zoxc:no-interleave-panics, r=michaelwoerister
Lock stderr in panic handler Fixes rust-lang#119789.
2 parents 3b85d2c + 288380d commit 7de1a1f

File tree

1 file changed

+3
-0
lines changed
  • compiler/rustc_driver_impl/src

1 file changed

+3
-0
lines changed

compiler/rustc_driver_impl/src/lib.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1327,6 +1327,9 @@ pub fn install_ice_hook(
13271327
panic::update_hook(Box::new(
13281328
move |default_hook: &(dyn Fn(&PanicInfo<'_>) + Send + Sync + 'static),
13291329
info: &PanicInfo<'_>| {
1330+
// Lock stderr to prevent interleaving of concurrent panics.
1331+
let _guard = io::stderr().lock();
1332+
13301333
// If the error was caused by a broken pipe then this is not a bug.
13311334
// Write the error and return immediately. See #98700.
13321335
#[cfg(windows)]

0 commit comments

Comments
 (0)