Skip to content

Commit 3d50eba

Browse files
Rollup merge of #134781 - Zalathar:backtrace, r=SparrowLii,jieyouxu
Add more `begin_panic` normalizations to panic backtrace tests Since #123244, these tests have started failing locally on some systems (#133997) due to minor variations in how `begin_panic` is printed in the backtrace. The variation appears to occur on macOS when `rust.debuginfo-level = "line-tables-only"` is set, which is the default in `config.compiler.toml`. It does not occur when the debuginfo level is set to 1. The variation doesn't seem relevant to these tests, so this PR simply adds another custom normalization rule to account for the variation. --- Will conflict with #134759.
2 parents 3e02ddb + 1511de3 commit 3d50eba

8 files changed

+12
-4
lines changed

tests/ui/panics/issue-47429-short-backtraces.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
1010
// symbols.
1111
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
12+
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
13+
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
1214
// And this is for differences between std with and without debuginfo.
1315
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
1416

tests/ui/panics/issue-47429-short-backtraces.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:24:5:
1+
thread 'main' panicked at $DIR/issue-47429-short-backtraces.rs:26:5:
22
explicit panic
33
stack backtrace:
44
0: std::panicking::begin_panic

tests/ui/panics/runtime-switch.rs

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
1010
// symbols.
1111
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
12+
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
13+
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
1214
// And this is for differences between std with and without debuginfo.
1315
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
1416

tests/ui/panics/runtime-switch.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at $DIR/runtime-switch.rs:27:5:
1+
thread 'main' panicked at $DIR/runtime-switch.rs:29:5:
22
explicit panic
33
stack backtrace:
44
0: std::panicking::begin_panic

tests/ui/panics/short-ice-remove-middle-frames-2.rs

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
1313
// symbols.
1414
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
15+
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
16+
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
1517
// And this is for differences between std with and without debuginfo.
1618
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
1719

tests/ui/panics/short-ice-remove-middle-frames-2.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:61:5:
1+
thread 'main' panicked at $DIR/short-ice-remove-middle-frames-2.rs:63:5:
22
debug!!!
33
stack backtrace:
44
0: std::panicking::begin_panic

tests/ui/panics/short-ice-remove-middle-frames.rs

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// This is needed to avoid test output differences across std being built with v0 symbols vs legacy
1414
// symbols.
1515
//@ normalize-stderr-test: "begin_panic::<&str>" -> "begin_panic"
16+
// This variant occurs on macOS with `rust.debuginfo-level = "line-tables-only"` (#133997)
17+
//@ normalize-stderr-test: " begin_panic<&str>" -> " std::panicking::begin_panic"
1618
// And this is for differences between std with and without debuginfo.
1719
//@ normalize-stderr-test: "\n +at [^\n]+" -> ""
1820

tests/ui/panics/short-ice-remove-middle-frames.run.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:57:5:
1+
thread 'main' panicked at $DIR/short-ice-remove-middle-frames.rs:59:5:
22
debug!!!
33
stack backtrace:
44
0: std::panicking::begin_panic

0 commit comments

Comments
 (0)