about summary refs log tree commit diff
path: root/tests/ui/backtrace/synchronized-panic-handler.rs
diff options
context:
space:
mode:
authorjyn <github@jyn.dev>2024-07-05 17:24:10 -0400
committerjyn <github@jyn.dev>2024-07-12 11:52:04 -0400
commit1c8f9bb84d5956abe6671bf77ccaba64505266a5 (patch)
tree392bbbc17025cf590dea0819277c294f6e07149d /tests/ui/backtrace/synchronized-panic-handler.rs
parentde14f1f932f4f11130be3fed5cd370bd0936032e (diff)
downloadrust-1c8f9bb84d5956abe6671bf77ccaba64505266a5.tar.gz
rust-1c8f9bb84d5956abe6671bf77ccaba64505266a5.zip
fix interleaved panic output
previously, we only held a lock for printing the backtrace itself. since all threads were printing to the same file descriptor, that meant random output in the default panic hook would be interleaved with the backtrace. now, we hold the lock for the full duration of the hook, and the output is ordered.
Diffstat (limited to 'tests/ui/backtrace/synchronized-panic-handler.rs')
-rw-r--r--tests/ui/backtrace/synchronized-panic-handler.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/ui/backtrace/synchronized-panic-handler.rs b/tests/ui/backtrace/synchronized-panic-handler.rs
index 0ea285968d5..00eb249da1d 100644
--- a/tests/ui/backtrace/synchronized-panic-handler.rs
+++ b/tests/ui/backtrace/synchronized-panic-handler.rs
@@ -1,6 +1,8 @@
 //@ run-pass
 //@ check-run-results
 //@ edition:2021
+//@ exec-env:RUST_BACKTRACE=0
+//@ needs-threads
 use std::thread;
 const PANIC_MESSAGE: &str = "oops oh no woe is me";