about summary refs log tree commit diff
path: root/tests/ui/numbers-arithmetic
diff options
context:
space:
mode:
authorTrevor Gross <tmgross@umich.edu>2023-09-11 00:59:31 -0400
committerTrevor Gross <tmgross@umich.edu>2025-08-06 23:59:47 +0000
commit289fe36d373c5a13fa7f1b93f39ff88425ab2351 (patch)
tree410435fc6fa49a1ffd25c9e52e579087ed639c5e /tests/ui/numbers-arithmetic
parent0c8b3870bd9ec60093b478b318858fdb220846b7 (diff)
downloadrust-289fe36d373c5a13fa7f1b93f39ff88425ab2351.tar.gz
rust-289fe36d373c5a13fa7f1b93f39ff88425ab2351.zip
Print thread ID in panic message if thread name is unknown
`panic!` does not print any identifying information for threads that are
unnamed. However, in many cases, the thread ID can be determined.

This changes the panic message from something like this:

    thread '<unnamed>' panicked at src/main.rs:3:5:
    explicit panic

To something like this:

    thread '<unnamed>' (0xff9bf) panicked at src/main.rs:3:5:
    explicit panic

Stack overflow messages are updated as well.

This change applies to both named and unnamed threads. The ID printed is
the OS integer thread ID rather than the Rust thread ID, which should
also be what debuggers print.
Diffstat (limited to 'tests/ui/numbers-arithmetic')
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-add.rs4
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-mul.rs4
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-pow-signed.rs4
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs4
-rw-r--r--tests/ui/numbers-arithmetic/overflowing-sub.rs4
5 files changed, 10 insertions, 10 deletions
diff --git a/tests/ui/numbers-arithmetic/overflowing-add.rs b/tests/ui/numbers-arithmetic/overflowing-add.rs
index c1f498c802b..a63fc3bccf1 100644
--- a/tests/ui/numbers-arithmetic/overflowing-add.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-add.rs
@@ -1,6 +1,6 @@
 //@ run-fail
-//@ error-pattern:thread 'main' panicked
-//@ error-pattern:attempt to add with overflow
+//@ regex-error-pattern: thread 'main'.*panicked
+//@ error-pattern: attempt to add with overflow
 //@ compile-flags: -C debug-assertions
 //@ needs-subprocess
 
diff --git a/tests/ui/numbers-arithmetic/overflowing-mul.rs b/tests/ui/numbers-arithmetic/overflowing-mul.rs
index 0eece536929..2645a32d5ad 100644
--- a/tests/ui/numbers-arithmetic/overflowing-mul.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-mul.rs
@@ -1,6 +1,6 @@
 //@ run-fail
-//@ error-pattern:thread 'main' panicked
-//@ error-pattern:attempt to multiply with overflow
+//@ regex-error-pattern: thread 'main'.*panicked
+//@ error-pattern: attempt to multiply with overflow
 //@ needs-subprocess
 //@ compile-flags: -C debug-assertions
 
diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs
index 28deb7cf6ba..6db6682e16f 100644
--- a/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-pow-signed.rs
@@ -1,6 +1,6 @@
 //@ run-fail
-//@ error-pattern:thread 'main' panicked
-//@ error-pattern:attempt to multiply with overflow
+//@ regex-error-pattern: thread 'main'.*panicked
+//@ error-pattern: attempt to multiply with overflow
 //@ needs-subprocess
 //@ compile-flags: -C debug-assertions
 
diff --git a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
index dea9a4d5428..bde0de6f6f5 100644
--- a/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-pow-unsigned.rs
@@ -1,6 +1,6 @@
 //@ run-fail
-//@ error-pattern:thread 'main' panicked
-//@ error-pattern:attempt to multiply with overflow
+//@ regex-error-pattern: thread 'main'.*panicked
+//@ error-pattern: attempt to multiply with overflow
 //@ needs-subprocess
 //@ compile-flags: -C debug-assertions
 
diff --git a/tests/ui/numbers-arithmetic/overflowing-sub.rs b/tests/ui/numbers-arithmetic/overflowing-sub.rs
index 88b1b693f63..1718fccad7a 100644
--- a/tests/ui/numbers-arithmetic/overflowing-sub.rs
+++ b/tests/ui/numbers-arithmetic/overflowing-sub.rs
@@ -1,6 +1,6 @@
 //@ run-fail
-//@ error-pattern:thread 'main' panicked
-//@ error-pattern:attempt to subtract with overflow
+//@ regex-error-pattern: thread 'main'.*panicked
+//@ error-pattern: attempt to subtract with overflow
 //@ needs-subprocess
 //@ compile-flags: -C debug-assertions