Skip to content

Commit

Permalink
Auto merge of rust-lang#122565 - Zoxc:atomic-panic-msg, r=the8472
Browse files Browse the repository at this point in the history
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)
```
  • Loading branch information
bors committed Oct 16, 2024
2 parents 9ce3675 + a59ae4c commit 6601467
Show file tree
Hide file tree
Showing 87 changed files with 156 additions and 20 deletions.
18 changes: 17 additions & 1 deletion library/std/src/panicking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,23 @@ fn default_hook(info: &PanicHookInfo<'_>) {
// Use a lock to prevent mixed output in multithreading context.
// Some platforms also require it when printing a backtrace, like `SymFromAddr` on Windows.
let mut lock = backtrace::lock();
let _ = writeln!(err, "thread '{name}' panicked at {location}:\n{msg}");
// Try to write the panic message to a buffer first to prevent other concurrent outputs
// interleaving with it.
let mut buffer = [0u8; 512];
let mut cursor = crate::io::Cursor::new(&mut buffer[..]);

let write_msg = |dst: &mut dyn crate::io::Write| {
// We add a newline to ensure the panic message appears at the start of a line.
writeln!(dst, "\nthread '{name}' panicked at {location}:\n{msg}")
};

if write_msg(&mut cursor).is_ok() {
let pos = cursor.position() as usize;
let _ = err.write_all(&buffer[0..pos]);
} else {
// The message did not fit into the buffer, write it directly instead.
let _ = write_msg(err);
};

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind1.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

thread 'main' panicked at tests/fail/function_calls/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

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

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

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
aborted execution: attempted to instantiate uninhabited type `!`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/fail/intrinsics/zero_fn_ptr.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
aborted execution: attempted to zero-initialize type `fn()`, which is invalid
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
2 changes: 2 additions & 0 deletions src/tools/miri/tests/fail/panic/abort_unwind.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

thread 'main' panicked at tests/fail/panic/abort_unwind.rs:LL:CC:
PANIC!!!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/fail/panic/bad_unwind.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/fail/panic/bad_unwind.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
3 changes: 3 additions & 0 deletions src/tools/miri/tests/fail/panic/double_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
first
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at tests/fail/panic/double_panic.rs:LL:CC:
second
stack backtrace:

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a destructor during cleanup
thread caused non-unwinding panic. aborting.
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/fail/panic/panic_abort1.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/fail/panic/panic_abort1.rs:LL:CC:
panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/fail/panic/panic_abort2.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/fail/panic/panic_abort2.rs:LL:CC:
42-panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/fail/panic/panic_abort3.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/fail/panic/panic_abort3.rs:LL:CC:
panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/fail/panic/panic_abort4.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

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

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

thread $NAME panicked at tests/fail/panic/tls_macro_drop_panic.rs:LL:CC:
ow
fatal runtime error: thread local panicked on drop
Expand Down
2 changes: 2 additions & 0 deletions src/tools/miri/tests/fail/terminate-terminator.stderr
Original file line number Diff line number Diff line change
@@ -1,9 +1,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.


thread 'main' panicked at tests/fail/terminate-terminator.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
2 changes: 2 additions & 0 deletions src/tools/miri/tests/fail/unwind-action-terminate.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

thread 'main' panicked at tests/fail/unwind-action-terminate.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/alloc_error_handler_hook.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

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

thread 'main' panicked at RUSTLIB/std/src/alloc.rs:LL:CC:
memory allocation of 4 bytes failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/div-by-zero-2.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/div-by-zero-2.rs:LL:CC:
attempt to divide by zero
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@

thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
explicit panic

thread 'main' panicked at tests/panic/function_calls/exported_symbol_good_unwind.rs:LL:CC:
explicit panic
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/mir-validation.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'rustc' panicked at compiler/rustc_mir_transform/src/validate.rs:LL:CC:
broken MIR in Item(DefId) (after phase change to runtime-optimized) at bb0[1]:
place (*(_2.0: *mut i32)) has deref as a later projection (it is only permitted as the first projection)
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/oob_subslice.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/oob_subslice.rs:LL:CC:
range end index 5 out of range for slice of length 4
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/overflowing-lsh-neg.rs:LL:CC:
attempt to shift left with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/overflowing-rsh-1.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/overflowing-rsh-1.rs:LL:CC:
attempt to shift right with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/overflowing-rsh-2.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/overflowing-rsh-2.rs:LL:CC:
attempt to shift right with overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/panic1.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/panic1.rs:LL:CC:
panicking from libstd
stack backtrace:
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/panic2.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/panic2.rs:LL:CC:
42-panicking from libstd
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/panic3.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/panic3.rs:LL:CC:
panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/panic4.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/panic4.rs:LL:CC:
42-panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/transmute_fat2.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at tests/panic/transmute_fat2.rs:LL:CC:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
11 changes: 11 additions & 0 deletions src/tools/miri/tests/pass/panic/catch_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,35 +1,46 @@

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Hello from std::panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
Caught panic message (&str): Hello from std::panic

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Hello from std::panic: 1
Caught panic message (String): Hello from std::panic: 1

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Hello from std::panic_any: 2
Caught panic message (String): Hello from std::panic_any: 2

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Box<dyn Any>
Failed to get caught panic message.

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Hello from core::panic
Caught panic message (&str): Hello from core::panic

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
Hello from core::panic: 5
Caught panic message (String): Hello from core::panic: 5

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
index out of bounds: the len is 3 but the index is 4
Caught panic message (String): index out of bounds: the len is 3 but the index is 4

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
attempt to divide by zero
Caught panic message (&str): attempt to divide by zero

thread 'main' panicked at RUSTLIB/core/src/ptr/const_ptr.rs:LL:CC:
align_offset: align is not a power-of-two
Caught panic message (&str): align_offset: align is not a power-of-two

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
assertion failed: false
Caught panic message (&str): assertion failed: false

thread 'main' panicked at tests/pass/panic/catch_panic.rs:LL:CC:
assertion failed: false
Caught panic message (&str): assertion failed: false
Expand Down
2 changes: 2 additions & 0 deletions src/tools/miri/tests/pass/panic/concurrent-panic.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
Thread 1 starting, will block on mutex
Thread 1 reported it has started

thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
panic in thread 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
Thread 2 blocking on thread 1
Thread 2 reported it has started
Unlocking mutex

thread '<unnamed>' panicked at tests/pass/panic/concurrent-panic.rs:LL:CC:
panic in thread 1
Thread 1 has exited
Expand Down
2 changes: 2 additions & 0 deletions src/tools/miri/tests/pass/panic/nested_panic_caught.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
once
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'main' panicked at tests/pass/panic/nested_panic_caught.rs:LL:CC:
twice
stack backtrace:
2 changes: 2 additions & 0 deletions src/tools/miri/tests/pass/panic/thread_panic.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

thread '<unnamed>' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
Hello!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect

thread 'childthread' panicked at tests/pass/panic/thread_panic.rs:LL:CC:
Hello, world!
2 changes: 1 addition & 1 deletion tests/run-make/libtest-json/output-default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{ "type": "test", "event": "started", "name": "a" }
{ "type": "test", "name": "a", "event": "ok" }
{ "type": "test", "event": "started", "name": "b" }
{ "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" }
{ "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" }
{ "type": "test", "event": "started", "name": "c" }
{ "type": "test", "name": "c", "event": "ok" }
{ "type": "test", "event": "started", "name": "d" }
Expand Down
4 changes: 2 additions & 2 deletions tests/run-make/libtest-json/output-stdout-success.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
{ "type": "test", "event": "started", "name": "a" }
{ "type": "test", "name": "a", "event": "ok", "stdout": "print from successful test\n" }
{ "type": "test", "event": "started", "name": "b" }
{ "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" }
{ "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" }
{ "type": "test", "event": "started", "name": "c" }
{ "type": "test", "name": "c", "event": "ok", "stdout": "thread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" }
{ "type": "test", "name": "c", "event": "ok", "stdout": "\nthread 'c' panicked at f.rs:15:5:\nassertion failed: false\n" }
{ "type": "test", "event": "started", "name": "d" }
{ "type": "test", "name": "d", "event": "ignored", "message": "msg" }
{ "type": "suite", "event": "failed", "passed": 2, "failed": 1, "ignored": 1, "measured": 0, "filtered_out": 0, "exec_time": "$EXEC_TIME" }
2 changes: 1 addition & 1 deletion tests/run-make/libtest-junit/output-default.xml
Original file line number Diff line number Diff line change
@@ -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>
<?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>
2 changes: 1 addition & 1 deletion tests/run-make/libtest-junit/output-stdout-success.xml
Original file line number Diff line number Diff line change
@@ -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>
<?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>
1 change: 1 addition & 0 deletions tests/rustdoc-ui/doctest/failed-doctest-output.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ stdout 2
stderr:
stderr 1
stderr 2

thread 'main' panicked at $DIR/failed-doctest-output.rs:7:1:
oh no
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions tests/rustdoc-ui/ice-bug-report-url.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ LL | fn wrong()
| ^ expected one of `->`, `where`, or `{`



aborting due to `-Z treat-err-as-bug=1`
stack backtrace:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ failures:
Test executable failed (exit status: 101).

stderr:

thread 'main' panicked at remapped_path/remap-path-prefix-failed-doctest-output.rs:3:1:
oh no
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/backtrace/synchronized-panic-handler.run.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
oops oh no woe is me
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread '<unnamed>' panicked at $DIR/synchronized-panic-handler.rs:11:5:
oops oh no woe is me
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
error: internal compiler error: compiler/rustc_const_eval/src/interpret/operator.rs:LL:CC: unsized type for `NullaryOp::SizeOf`
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL


Box<dyn Any>
query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `<impl at $DIR/issue-80742.rs:26:1: 28:32>::{constant#0}`
Expand Down
1 change: 1 addition & 0 deletions tests/ui/consts/const-eval/const-eval-query-stack.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ error: internal compiler error[E0080]: evaluation of constant value failed
LL | const X: i32 = 1 / 0;
| ^^^^^ attempt to divide `1_i32` by zero


note: please make sure that you have updated to the latest nightly

query stack during panic:
Expand Down
1 change: 1 addition & 0 deletions tests/ui/extern/extern-types-field-offset.run.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
attempted to compute the size or alignment of extern type `Opaque`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions tests/ui/extern/extern-types-size_of_val.align.run.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
attempted to compute the size or alignment of extern type `A`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
1 change: 1 addition & 0 deletions tests/ui/extern/extern-types-size_of_val.size.run.stderr
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

thread 'main' panicked at core/src/panicking.rs:$LINE:$COL:
attempted to compute the size or alignment of extern type `A`
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
Loading

0 comments on commit 6601467

Please sign in to comment.