Skip to content

Commit 82a4bef

Browse files
committed
Lock stderr in panic handler
1 parent a655e64 commit 82a4bef

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
@@ -1312,6 +1312,9 @@ pub fn install_ice_hook(
13121312
std::env::set_var("RUST_BACKTRACE", "full");
13131313
}
13141314

1315+
// Lock stderr to prevent interleaving of concurrent panics.
1316+
let _guard = io::stderr().lock();
1317+
13151318
let using_internal_features = Arc::new(std::sync::atomic::AtomicBool::default());
13161319
let using_internal_features_hook = using_internal_features.clone();
13171320
panic::update_hook(Box::new(

0 commit comments

Comments
 (0)