Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to write the panic message with a single write_all call #122565

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 15 additions & 1 deletion library/std/src/panicking.rs
Expand Up @@ -260,7 +260,21 @@ fn default_hook(info: &PanicInfo<'_>) {
let name = thread.as_ref().and_then(|t| t.name()).unwrap_or("<unnamed>");

let write = |err: &mut dyn crate::io::Write| {
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| {
writeln!(dst, "\nthread '{name}' panicked at {location}:\n{msg}")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to separate the functional change (more newlines) from the implementation change. Makes it easier to discuss and decide on these separately.

A leading newline is not very common in Rust output, so if it stays it definitely needs a comment explaining the purpose.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Panic output isn't stable. There's some work to add thread IDs to the panic message for example.

Yeah the extra newline is unusual, but this is an unsynchronized write to a shared output so we don't have many options to clean up the formatting in cases where a panic is emitted in the middle of something else that's printing.

proc_macro_generated_packed.stderr is a good example of this. It start printing the panic message in the middle of reporting another error.

Do you think it's disruptive enough that it warrants separate discussion?

};

let _ = if write_msg(&mut cursor).is_ok() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be less confusing to move the let _ into the arms (showing more clearly that it's just ignoring IO errors).

let pos = cursor.position() as usize;
err.write_all(&buffer[0..pos])
} else {
write_msg(err)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
write_msg(err)
// The message does not fit into the buffer, write it directly to stderr instead.
write_msg(err)

};

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

Expand Down
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/exported_symbol_bad_unwind1.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
@@ -1,6 +1,8 @@

thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
panic in a function that cannot unwind
stack backtrace:
Expand Down
@@ -1,6 +1,8 @@

thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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

thread 'main' panicked at $DIR/exported_symbol_bad_unwind2.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/return_pointer_on_unwind.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
@@ -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
@@ -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
1 change: 1 addition & 0 deletions src/tools/miri/tests/fail/panic/bad_unwind.stderr
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/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
@@ -1,9 +1,12 @@

thread 'main' panicked at $DIR/double_panic.rs:LL:CC:
first
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' panicked at $DIR/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
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/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
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/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
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/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
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/panic_abort4.rs:LL:CC:
42-panicking from libcore
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Expand Down
@@ -1,3 +1,4 @@

thread $NAME panicked at $DIR/tls_macro_const_drop_panic.rs:LL:CC:
ow
fatal runtime error: thread local panicked on drop
Expand Down
@@ -1,3 +1,4 @@

thread $NAME panicked at $DIR/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
@@ -1,8 +1,10 @@
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 $DIR/terminate-terminator.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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
@@ -1,6 +1,8 @@

thread 'main' panicked at $DIR/unwind-action-terminate.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/div-by-zero-2.stderr
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/div-by-zero-2.rs:LL:CC:
attempt to divide by zero
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@@ -1,7 +1,10 @@

thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
explicit panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
explicit panic

thread 'main' panicked at $DIR/exported_symbol_good_unwind.rs:LL:CC:
explicit panic
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/oob_subslice.stderr
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/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
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/overflowing-lsh-neg.stderr
@@ -1,3 +1,4 @@

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

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

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

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

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

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

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

thread 'main' panicked at $DIR/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
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/unsupported_foreign_function.rs:LL:CC:
unsupported Miri functionality: can't call foreign function `foo` on $OS
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1 change: 1 addition & 0 deletions src/tools/miri/tests/panic/unsupported_syscall.stderr
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/unsupported_syscall.rs:LL:CC:
unsupported Miri functionality: can't execute syscall with ID 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
11 changes: 11 additions & 0 deletions src/tools/miri/tests/pass/panic/catch_panic.stderr
@@ -1,34 +1,45 @@

thread 'main' panicked at $DIR/catch_panic.rs:LL:CC:
Hello from std::panic
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Caught panic message (&str): Hello from std::panic

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

thread 'main' panicked at $DIR/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 $DIR/catch_panic.rs:LL:CC:
Box<dyn Any>
Failed to get caught panic message.

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

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

thread 'main' panicked at $DIR/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 $DIR/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 $DIR/catch_panic.rs:LL:CC:
assertion failed: false
Caught panic message (&str): assertion failed: false

thread 'main' panicked at $DIR/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
@@ -1,11 +1,13 @@
Thread 1 starting, will block on mutex
Thread 1 reported it has started

thread '<unnamed>' panicked at $DIR/concurrent-panic.rs:LL:CC:
panic in thread 2
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Thread 2 blocking on thread 1
Thread 2 reported it has started
Unlocking mutex

thread '<unnamed>' panicked at $DIR/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
@@ -1,6 +1,8 @@

thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC:
once
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' panicked at $DIR/nested_panic_caught.rs:LL:CC:
twice
stack backtrace:
2 changes: 2 additions & 0 deletions src/tools/miri/tests/pass/panic/thread_panic.stderr
@@ -1,5 +1,7 @@

thread '<unnamed>' panicked at $DIR/thread_panic.rs:LL:CC:
Hello!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'childthread' panicked at $DIR/thread_panic.rs:LL:CC:
Hello, world!
2 changes: 1 addition & 1 deletion tests/run-make/libtest-json/output-default.json
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
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": $TIME }
2 changes: 1 addition & 1 deletion tests/run-make/libtest-junit/output-default.xml
@@ -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
@@ -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
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
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
@@ -1,6 +1,7 @@
error: internal compiler error: compiler/rustc_const_eval/src/interpret/step.rs:LL:CC: SizeOf MIR operator called for unsized type dyn Debug
--> $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
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


query stack during panic:
#0 [eval_to_allocation_raw] const-evaluating + checking `X`
#1 [eval_to_const_value_raw] simplifying constant for the type system `X`
Expand Down
1 change: 1 addition & 0 deletions tests/ui/extern/extern-types-field-offset.run.stderr
@@ -1,3 +1,4 @@

thread 'main' panicked at library/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
@@ -1,3 +1,4 @@

thread 'main' panicked at library/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
@@ -1,3 +1,4 @@

thread 'main' panicked at library/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/higher-ranked/trait-bounds/future.current.stderr
@@ -1,3 +1,4 @@

error: the compiler unexpectedly panicked. this is a bug.

query stack during panic:
Expand Down
1 change: 1 addition & 0 deletions tests/ui/hygiene/panic-location.run.stderr
@@ -1,3 +1,4 @@

thread 'main' panicked at library/alloc/src/raw_vec.rs:LL:CC:
capacity overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/const-eval-select-backtrace-std.rs:6:8:
byte index 1 is out of bounds of ``
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1 change: 1 addition & 0 deletions tests/ui/intrinsics/const-eval-select-backtrace.run.stderr
@@ -1,3 +1,4 @@

thread 'main' panicked at $DIR/const-eval-select-backtrace.rs:15:5:
Aaah!
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
1 change: 1 addition & 0 deletions tests/ui/intrinsics/not-overridden.stderr
Expand Up @@ -4,6 +4,7 @@ error: must be overridden by codegen backend, but isn't
LL | unsafe { const_deallocate(std::ptr::null_mut(), 0, 0) }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


query stack during panic:
end of query stack
error: aborting due to 1 previous error
Expand Down
2 changes: 2 additions & 0 deletions tests/ui/issues/issue-87707.run.stderr
@@ -1,5 +1,7 @@

thread 'main' panicked at $DIR/issue-87707.rs:14:24:
Here Once instance is poisoned.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

thread 'main' panicked at $DIR/issue-87707.rs:16:7:
Once instance has previously been poisoned
1 change: 1 addition & 0 deletions tests/ui/layout/valid_range_oob.stderr
@@ -1,3 +1,4 @@

257 > 255
error: the compiler unexpectedly panicked. this is a bug.

Expand Down