Skip to content

Commit ab3924b

Browse files
committed
Auto merge of rust-lang#122565 - Zoxc:atomic-panic-msg, r=the8472
Try to write the panic message with a single `write_all` call This writes the panic message to a buffer before writing to stderr. This allows it to be printed with a single `write_all` call, preventing it from being interleaved with other outputs. It also adds newlines before and after the message ensuring that only the panic message will have its own lines. Before: ``` thread 'thread 'thread 'thread 'thread '<unnamed>thread 'thread 'thread 'thread '<unnamed><unnamed>thread '<unnamed>' panicked at ' panicked at <unnamed><unnamed><unnamed><unnamed><unnamed>' panicked at <unnamed>' panicked at src\heap.rssrc\heap.rs' panicked at ' panicked at ' panicked at ' panicked at ' panicked at src\heap.rs' panicked at src\heap.rs::src\heap.rssrc\heap.rssrc\heap.rssrc\heap.rssrc\heap.rs:src\heap.rs:455455:::::455:455::455455455455455:455:99:::::9:9: : 999: 999: assertion failed: size <= (*queue).block_size: : assertion failed: size <= (*queue).block_size: assertion failed: size <= (*queue).block_size: : : assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_size assertion failed: size <= (*queue).block_size assertion failed: size <= (*queue).block_sizeassertion failed: size <= (*queue).block_sizeerror: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN) ``` After: ``` thread '<unnamed>' panicked at src\heap.rs:455:9: assertion failed: size <= (*queue).block_size thread '<unnamed>' panicked at src\heap.rs:455:9: assertion failed: size <= (*queue).block_size thread '<unnamed>' panicked at src\heap.rs:455:9: assertion failed: size <= (*queue).block_size error: process didn't exit successfully: `target\debug\direct_test.exe` (exit code: 0xc0000409, STATUS_STACK_BUFFER_OVERRUN) ``` --- try-jobs: x86_64-gnu-llvm-18
2 parents 4363f9b + 4bf85c2 commit ab3924b

File tree

85 files changed

+153
-20
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+153
-20
lines changed

Diff for: library/std/src/panicking.rs

+17-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,23 @@ fn default_hook(info: &PanicHookInfo<'_>) {
266266
// Use a lock to prevent mixed output in multithreading context.
267267
// Some platforms also require it when printing a backtrace, like `SymFromAddr` on Windows.
268268
let mut lock = backtrace::lock();
269-
let _ = writeln!(err, "thread '{name}' panicked at {location}:\n{msg}");
269+
// Try to write the panic message to a buffer first to prevent other concurrent outputs
270+
// interleaving with it.
271+
let mut buffer = [0u8; 512];
272+
let mut cursor = crate::io::Cursor::new(&mut buffer[..]);
273+
274+
let write_msg = |dst: &mut dyn crate::io::Write| {
275+
// We add a newline to ensure the panic message appears at the start of a line.
276+
writeln!(dst, "\nthread '{name}' panicked at {location}:\n{msg}")
277+
};
278+
279+
if write_msg(&mut cursor).is_ok() {
280+
let pos = cursor.position() as usize;
281+
let _ = err.write_all(&buffer[0..pos]);
282+
} else {
283+
// The message did not fit into the buffer, write it directly instead.
284+
let _ = write_msg(err);
285+
};
270286

271287
static FIRST_PANIC: AtomicBool = AtomicBool::new(true);
272288

Diff for: src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind1.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.both.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
12
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
68
panic in a function that cannot unwind
79
stack backtrace:

Diff for: src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.definition.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
12
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
68
panic in a function that cannot unwind
79
stack backtrace:

Diff for: src/tools/miri/tests/fail/function_calls/exported_symbol_bad_unwind2.extern_block.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/function_calls/return_pointer_on_unwind.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/function_calls/return_pointer_on_unwind.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/intrinsics/uninit_uninhabited_type.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
23
aborted execution: attempted to instantiate uninhabited type `!`
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
23
aborted execution: attempted to zero-initialize type `fn()`, which is invalid
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/panic/abort_unwind.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
12
thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
23
PANIC!!!
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
68
panic in a function that cannot unwind
79
stack backtrace:

Diff for: src/tools/miri/tests/fail/panic/bad_unwind.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/panic/double_panic.stderr

+3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1+
12
thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
23
first
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
68
second
79
stack backtrace:
10+
811
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
912
panic in a destructor during cleanup
1013
thread caused non-unwinding panic. aborting.

Diff for: src/tools/miri/tests/fail/panic/panic_abort1.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
23
panicking from libstd
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/panic/panic_abort2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
23
42-panicking from libstd
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/panic/panic_abort3.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
23
panicking from libcore
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/panic/panic_abort4.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/fail/panic/panic_abort4.rs:LL:CC:
23
42-panicking from libcore
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/fail/panic/tls_macro_const_drop_panic.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread $NAME panicked at tests/fail/panic/tls_macro_const_drop_panic.rs:LL:CC:
23
ow
34
fatal runtime error: thread local panicked on drop

Diff for: src/tools/miri/tests/fail/panic/tls_macro_drop_panic.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC:
23
ow
34
fatal runtime error: thread local panicked on drop

Diff for: src/tools/miri/tests/fail/terminate-terminator.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
warning: You have explicitly enabled MIR optimizations, overriding Miri's default which is to completely disable them. Any optimizations may hide UB that Miri would otherwise detect, and it is not necessarily possible to predict what kind of UB will be missed. If you are enabling optimizations to make Miri run faster, we advise using cfg(miri) to shrink your workload instead. The performance benefit of enabling MIR optimizations is usually marginal at best.
22

3+
34
thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC:
45
explicit panic
56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
67
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
8+
79
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
810
panic in a function that cannot unwind
911
stack backtrace:

Diff for: src/tools/miri/tests/fail/unwind-action-terminate.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
12
thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
68
panic in a function that cannot unwind
79
stack backtrace:

Diff for: src/tools/miri/tests/panic/alloc_error_handler_hook.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/alloc_error_handler_hook.rs:LL:CC:
23
alloc error hook called
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/alloc_error_handler_panic.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at RUSTLIB/std/src/alloc.rs:LL:CC:
23
memory allocation of 4 bytes failed
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/div-by-zero-2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC:
23
attempt to divide by zero
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
12
thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
23
explicit panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
68
explicit panic
9+
710
thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
811
explicit panic

Diff for: src/tools/miri/tests/panic/mir-validation.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:LL:CC:
23
broken MIR in Item(DefId) (after phase change to runtime-optimized) at bb0[1]:
34
place (*(_2.0: *mut i32)) has deref as a later projection (it is only permitted as the first projection)

Diff for: src/tools/miri/tests/panic/oob_subslice.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC:
23
range end index 5 out of range for slice of length 4
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/overflowing-lsh-neg.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC:
23
attempt to shift left with overflow
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/overflowing-rsh-1.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC:
23
attempt to shift right with overflow
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/overflowing-rsh-2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC:
23
attempt to shift right with overflow
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/panic1.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/panic1.rs:LL:CC:
23
panicking from libstd
34
stack backtrace:

Diff for: src/tools/miri/tests/panic/panic2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/panic2.rs:LL:CC:
23
42-panicking from libstd
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/panic3.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/panic3.rs:LL:CC:
23
panicking from libcore
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/panic4.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/panic4.rs:LL:CC:
23
42-panicking from libcore
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/panic/transmute_fat2.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC:
23
index out of bounds: the len is 0 but the index is 0
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: src/tools/miri/tests/pass/panic/catch_panic.stderr

+11
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,46 @@
1+
12
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
23
Hello from std::panic
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
56
Caught panic message (&str): Hello from std::panic
7+
68
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
79
Hello from std::panic: 1
810
Caught panic message (String): Hello from std::panic: 1
11+
912
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
1013
Hello from std::panic_any: 2
1114
Caught panic message (String): Hello from std::panic_any: 2
15+
1216
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
1317
Box<dyn Any>
1418
Failed to get caught panic message.
19+
1520
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
1621
Hello from core::panic
1722
Caught panic message (&str): Hello from core::panic
23+
1824
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
1925
Hello from core::panic: 5
2026
Caught panic message (String): Hello from core::panic: 5
27+
2128
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
2229
index out of bounds: the len is 3 but the index is 4
2330
Caught panic message (String): index out of bounds: the len is 3 but the index is 4
31+
2432
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
2533
attempt to divide by zero
2634
Caught panic message (&str): attempt to divide by zero
35+
2736
thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC:
2837
align_offset: align is not a power-of-two
2938
Caught panic message (&str): align_offset: align is not a power-of-two
39+
3040
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
3141
assertion failed: false
3242
Caught panic message (&str): assertion failed: false
43+
3344
thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
3445
assertion failed: false
3546
Caught panic message (&str): assertion failed: false

Diff for: src/tools/miri/tests/pass/panic/concurrent-panic.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
Thread 1 starting, will block on mutex
22
Thread 1 reported it has started
3+
34
thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
45
panic in thread 2
56
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
67
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
78
Thread 2 blocking on thread 1
89
Thread 2 reported it has started
910
Unlocking mutex
11+
1012
thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
1113
panic in thread 1
1214
Thread 1 has exited
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
12
thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
23
once
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
68
twice
79
stack backtrace:

Diff for: src/tools/miri/tests/pass/panic/thread_panic.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
12
thread '<unnamed>' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
23
Hello!
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
45
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
6+
57
thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
68
Hello, world!

Diff for: tests/run-make/libtest-json/output-default.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{ "type": "test", "event": "started", "name": "a" }
33
{ "type": "test", "name": "a", "event": "ok" }
44
{ "type": "test", "event": "started", "name": "b" }
5-
{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
5+
{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
66
{ "type": "test", "event": "started", "name": "c" }
77
{ "type": "test", "name": "c", "event": "ok" }
88
{ "type": "test", "event": "started", "name": "d" }

Diff for: tests/run-make/libtest-json/output-stdout-success.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
{ "type": "test", "event": "started", "name": "a" }
33
{ "type": "test", "name": "a", "event": "ok", "stdout": "print from successful test\n" }
44
{ "type": "test", "event": "started", "name": "b" }
5-
{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
5+
{ "type": "test", "name": "b", "event": "failed", "stdout": "\nthread 'b' panicked at f.rs:9:5:\nassertion failed: false\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n" }
66
{ "type": "test", "event": "started", "name": "c" }
7-
{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" }
7+
{ "type": "test", "name": "c", "event": "ok", "stdout": "\nthread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" }
88
{ "type": "test", "event": "started", "name": "d" }
99
{ "type": "test", "name": "d", "event": "ignored", "message": "msg" }
1010
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": "$EXEC_TIME" }

Diff for: tests/run-make/libtest-junit/output-default.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"/><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;<![CDATA[thread 'b' panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"/><system-out/><system-err/></testsuite></testsuites>
1+
<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"/><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;&#xA;<![CDATA[thread 'b' panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"/><system-out/><system-err/></testsuite></testsuites>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"><system-out><![CDATA[print from successful test]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;<![CDATA[thread 'b' panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"><system-out><![CDATA[thread 'c' panicked at f.rs:16:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[]]></system-out></testcase><system-out/><system-err/></testsuite></testsuites>
1+
<?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="1" tests="4" skipped="1" ><testcase classname="unknown" name="a" time="$TIME"><system-out><![CDATA[print from successful test]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="b" time="$TIME"><failure type="assert"/><system-out><![CDATA[print from failing test]]>&#xA;&#xA;<![CDATA[thread 'b' panicked at f.rs:10:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace]]>&#xA;<![CDATA[]]></system-out></testcase><testcase classname="unknown" name="c" time="$TIME"><system-out><![CDATA[]]>&#xA;<![CDATA[thread 'c' panicked at f.rs:16:5:]]>&#xA;<![CDATA[assertion failed: false]]>&#xA;<![CDATA[]]></system-out></testcase><system-out/><system-err/></testsuite></testsuites>

Diff for: tests/rustdoc-ui/doctest/failed-doctest-output-windows.stdout

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ stdout 2
2626
stderr:
2727
stderr 1
2828
stderr 2
29+
2930
thread 'main' panicked at $DIR/failed-doctest-output-windows.rs:7:1:
3031
oh no
3132
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/rustdoc-ui/doctest/failed-doctest-output.stdout

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ stdout 2
2626
stderr:
2727
stderr 1
2828
stderr 2
29+
2930
thread 'main' panicked at $DIR/failed-doctest-output.rs:7:1:
3031
oh no
3132
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Diff for: tests/rustdoc-ui/ice-bug-report-url.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | fn wrong()
55
| ^ expected one of `->`, `where`, or `{`
66

77

8+
89
aborting due to `-Z treat-err-as-bug=1`
910
stack backtrace:
1011

Diff for: tests/rustdoc-ui/remap-path-prefix-failed-doctest-output.stdout

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ failures:
88
Test executable failed (exit status: 101).
99

1010
stderr:
11+
1112
thread 'main' panicked at remapped_path/remap-path-prefix-failed-doctest-output.rs:3:1:
1213
oh no
1314
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
12
thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
23
oops oh no woe is me
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
5+
46
thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
57
oops oh no woe is me

Diff for: tests/ui/const-generics/generic_const_exprs/issue-80742.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
error: internal compiler error: compiler/rustc_const_eval/src/interpret/operator.rs:LL:CC: unsized type for `NullaryOp::SizeOf`
22
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL
33

4+
45
Box<dyn Any>
56
query stack during panic:
67
#0 [eval_to_allocation_raw] const-evaluating + checking `<impl at $DIR/issue-80742.rs:26:1: 28:32>::{constant#0}`

Diff for: tests/ui/consts/const-eval/const-eval-query-stack.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ error: internal compiler error[E0080]: evaluation of constant value failed
44
LL | const X: i32 = 1 / 0;
55
| ^^^^^ attempt to divide `1_i32` by zero
66

7+
78
note: please make sure that you have updated to the latest nightly
89

910
query stack during panic:

Diff for: tests/ui/extern/extern-types-field-offset.run.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
thread 'main' panicked at library/core/src/panicking.rs:$LINE:$COL:
23
attempted to compute the size or alignment of extern type `Opaque`
34
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

0 commit comments

Comments
 (0)