Skip to content

Commit cac7e42

Browse files
committed
Fix backtrace normalization in ice-bug-report-url.rs
This test case currently fails on s390x, and probably other platforms where the last line of a backtrace does not contain and " at <source location>" specification. The problem with the existing normalization lines // normalize-stderr-test "\s*\d{1,}: .*\n" -> "" // normalize-stderr-test "\s at .*\n" -> "" is that \s matches all whitespace, including newlines, so the first (but not second) of these regexes may merge multiple lines. Thus the output differs depending on which of these matches on the last line of a backtrace. As the whitespace used in backtraces is just normal space characters, change both regexes to just match at least one space character instead: // normalize-stderr-test " +\d{1,}: .*\n" -> "" // normalize-stderr-test " + at .*\n" -> ""
1 parent cba1407 commit cac7e42

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/rustdoc-ui/ice-bug-report-url.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// normalize-stderr-test "note: compiler flags.*\n\n" -> ""
77
// normalize-stderr-test "note: rustc.*running on.*" -> "note: rustc {version} running on {platform}"
88
// normalize-stderr-test "thread.*panicked at .*, compiler.*" -> "thread panicked at 'aborting due to `-Z treat-err-as-bug`'"
9-
// normalize-stderr-test "\s*\d{1,}: .*\n" -> ""
10-
// normalize-stderr-test "\s at .*\n" -> ""
9+
// normalize-stderr-test " +\d{1,}: .*\n" -> ""
10+
// normalize-stderr-test " + at .*\n" -> ""
1111
// normalize-stderr-test ".*note: Some details are omitted.*\n" -> ""
1212

1313
fn wrong()

tests/rustdoc-ui/ice-bug-report-url.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | fn wrong()
66

77
thread panicked at 'aborting due to `-Z treat-err-as-bug`'
88
stack backtrace:
9+
910
error: the compiler unexpectedly panicked. this is a bug.
1011

1112
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-rustdoc&template=ice.md

0 commit comments

Comments
 (0)