Skip to content

Commit 288380d

Browse files
committed
Lock stderr in panic handler
1 parent a655e64 commit 288380d

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
@@ -1317,6 +1317,9 @@ pub fn install_ice_hook(
13171317
panic::update_hook(Box::new(
13181318
move |default_hook: &(dyn Fn(&PanicInfo<'_>) + Send + Sync + 'static),
13191319
info: &PanicInfo<'_>| {
1320+
// Lock stderr to prevent interleaving of concurrent panics.
1321+
let _guard = io::stderr().lock();
1322+
13201323
// If the error was caused by a broken pipe then this is not a bug.
13211324
// Write the error and return immediately. See #98700.
13221325
#[cfg(windows)]

0 commit comments

Comments
 (0)