From: Ralf Jung Date: Sun, 25 Oct 2020 09:00:50 +0000 (+0100) Subject: rustup; make panic output less dependent on stdlib internals X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=ddcc4f241e1e9987b050067f4303d0449774b36e;p=rust.git rustup; make panic output less dependent on stdlib internals --- diff --git a/rust-version b/rust-version index d661d821503..44e9a77940d 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -8f0fa9d51ff4ad2c0869e660856cd327e79915e9 +17cc9b6256c95c31944591aec683884fead4e3b6 diff --git a/tests/run-pass/backtrace-std.rs b/tests/run-pass/backtrace-std.rs index 579b4f32e7c..fb596b1d202 100644 --- a/tests/run-pass/backtrace-std.rs +++ b/tests/run-pass/backtrace-std.rs @@ -1,5 +1,5 @@ -// normalize-stderr-test ".*/(rust|checkout)/library/" -> "RUSTLIB/" -// normalize-stderr-test "RUSTLIB/(.*):\d+:\d+ "-> "RUSTLIB/$1:LL:COL " +// normalize-stderr-test "at .*/(rust|checkout)/library/" -> "at RUSTLIB/" +// normalize-stderr-test "RUSTLIB/(.*):\d+"-> "RUSTLIB/$1:LL" // normalize-stderr-test "::<.*>" -> "" // compile-flags: -Zmiri-disable-isolation diff --git a/tests/run-pass/backtrace-std.stderr b/tests/run-pass/backtrace-std.stderr index d14735c0405..45c46acc331 100644 --- a/tests/run-pass/backtrace-std.stderr +++ b/tests/run-pass/backtrace-std.stderr @@ -9,20 +9,20 @@ 4: main at $DIR/backtrace-std.rs:21 5: >::call_once - shim(fn()) -RUSTLIB/core/src/ops/function.rs:227 + at RUSTLIB/core/src/ops/function.rs:LL 6: std::sys_common::backtrace::__rust_begin_short_backtrace -RUSTLIB/std/src/sys_common/backtrace.rs:125 + at RUSTLIB/std/src/sys_common/backtrace.rs:LL 7: std::rt::lang_start::{closure#0} -RUSTLIB/std/src/rt.rs:66 + at RUSTLIB/std/src/rt.rs:LL 8: std::ops::function::impls::call_once -RUSTLIB/core/src/ops/function.rs:259 + at RUSTLIB/core/src/ops/function.rs:LL 9: std::panicking::r#try::do_call -RUSTLIB/std/src/panicking.rs:381 + at RUSTLIB/std/src/panicking.rs:LL 10: std::panicking::r#try -RUSTLIB/std/src/panicking.rs:345 + at RUSTLIB/std/src/panicking.rs:LL 11: std::panic::catch_unwind -RUSTLIB/std/src/panic.rs:382 + at RUSTLIB/std/src/panic.rs:LL 12: std::rt::lang_start_internal -RUSTLIB/std/src/rt.rs:51 + at RUSTLIB/std/src/rt.rs:LL 13: std::rt::lang_start -RUSTLIB/std/src/rt.rs:65 + at RUSTLIB/std/src/rt.rs:LL diff --git a/tests/run-pass/panic/catch_panic.stderr b/tests/run-pass/panic/catch_panic.stderr index 30c7767b564..c4c04fece90 100644 --- a/tests/run-pass/panic/catch_panic.stderr +++ b/tests/run-pass/panic/catch_panic.stderr @@ -8,7 +8,7 @@ Caught panic message (String): Hello from panic: 2 thread 'main' panicked at 'Box', $DIR/catch_panic.rs:LL:27 Failed to get caught panic message. thread 'main' panicked at 'Hello from panic: core', $DIR/catch_panic.rs:LL:27 -Caught panic message (String): Hello from panic: core +Caught panic message (&str): Hello from panic: core thread 'main' panicked at 'Hello from panic: 5', $DIR/catch_panic.rs:LL:26 Caught panic message (String): Hello from panic: 5 thread 'main' panicked at 'Hello from panic: 6', $DIR/catch_panic.rs:LL:26 @@ -16,13 +16,13 @@ Caught panic message (String): Hello from panic: 6 thread 'main' panicked at 'index out of bounds: the len is 3 but the index is 4', $DIR/catch_panic.rs:LL:33 Caught panic message (String): index out of bounds: the len is 3 but the index is 4 thread 'main' panicked at 'attempt to divide by zero', $DIR/catch_panic.rs:LL:33 -Caught panic message (String): attempt to divide by zero +Caught panic message (&str): attempt to divide by zero thread 'main' panicked at 'align_offset: align is not a power-of-two', $LOC -Caught panic message (String): 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 'assertion failed: false', $DIR/catch_panic.rs:LL:29 Caught panic message (&str): assertion failed: false thread 'main' panicked at 'assertion failed: false', $DIR/catch_panic.rs:LL:29 Caught panic message (&str): assertion failed: false thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', $LOC -Caught panic message (String): called `Option::unwrap()` on a `None` value +Caught panic message (&str): called `Option::unwrap()` on a `None` value Success! diff --git a/tests/run-pass/panic/panic1.rs b/tests/run-pass/panic/panic1.rs index 4500c916ad6..08ac3a07285 100644 --- a/tests/run-pass/panic/panic1.rs +++ b/tests/run-pass/panic/panic1.rs @@ -1,9 +1,9 @@ // rustc-env: RUST_BACKTRACE=1 // compile-flags: -Zmiri-disable-isolation -// normalize-stderr-test ".*/(rust|checkout)/library/" -> "RUSTLIB/" -// normalize-stderr-test "RUSTLIB/(.*):\d+:\d+ "-> "RUSTLIB/$1:LL:COL " +// normalize-stderr-test "at .*/(rust|checkout)/library/.*" -> "at RUSTLIB/$$FILE:LL:COL" // normalize-stderr-test "::<.*>" -> "" + fn main() { std::panic!("panicking from libstd"); } diff --git a/tests/run-pass/panic/panic1.stderr b/tests/run-pass/panic/panic1.stderr index e06ec1b9ce3..e0f1aa5dad7 100644 --- a/tests/run-pass/panic/panic1.stderr +++ b/tests/run-pass/panic/panic1.stderr @@ -1,23 +1,23 @@ thread 'main' panicked at 'panicking from libstd', $DIR/panic1.rs:8:5 stack backtrace: 0: std::rt::begin_panic -RUSTLIB/std/src/panicking.rs:505:12 + at RUSTLIB/$FILE:LL:COL 1: main at $DIR/panic1.rs:8:5 2: >::call_once - shim(fn()) -RUSTLIB/core/src/ops/function.rs:227:5 + at RUSTLIB/$FILE:LL:COL 3: std::rt::lang_start::{closure#0} -RUSTLIB/std/src/rt.rs:66:18 + at RUSTLIB/$FILE:LL:COL 4: std::ops::function::impls::call_once -RUSTLIB/core/src/ops/function.rs:259:13 + at RUSTLIB/$FILE:LL:COL 5: std::panicking::r#try::do_call -RUSTLIB/std/src/panicking.rs:381:40 + at RUSTLIB/$FILE:LL:COL 6: std::panicking::r#try -RUSTLIB/std/src/panicking.rs:345:19 + at RUSTLIB/$FILE:LL:COL 7: std::panic::catch_unwind -RUSTLIB/std/src/panic.rs:382:14 + at RUSTLIB/$FILE:LL:COL 8: std::rt::lang_start_internal -RUSTLIB/std/src/rt.rs:51:25 + at RUSTLIB/$FILE:LL:COL 9: std::rt::lang_start -RUSTLIB/std/src/rt.rs:65:5 + at RUSTLIB/$FILE:LL:COL note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.