Skip to content

Commit 5b35d77

Browse files
committed
Add some track_caller info to precondition panics
1 parent fffd13c commit 5b35d77

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

tests/fail/ptr_swap_nonoverlapping.stderr

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
2+
thread 'main' panicked at tests/fail/ptr_swap_nonoverlapping.rs:LL:CC:
33
unsafe precondition(s) violated: ptr::swap_nonoverlapping requires that both pointer arguments are aligned and non-null and the specified memory ranges do not overlap
44

55
This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
@@ -18,9 +18,6 @@ LL | ABORT()
1818
= note: inside closure at RUSTLIB/std/src/panicking.rs:LL:CC
1919
= note: inside `std::sys::backtrace::__rust_end_short_backtrace::<{closure@std::panicking::begin_panic_handler::{closure#0}}, !>` at RUSTLIB/std/src/sys/backtrace.rs:LL:CC
2020
= note: inside `std::panicking::begin_panic_handler` at RUSTLIB/std/src/panicking.rs:LL:CC
21-
= note: inside `core::panicking::panic_nounwind` at RUSTLIB/core/src/panicking.rs:LL:CC
22-
= note: inside `std::ptr::swap_nonoverlapping::precondition_check` at RUSTLIB/core/src/ub_checks.rs:LL:CC
23-
= note: inside `std::ptr::swap_nonoverlapping::<usize>` at RUSTLIB/core/src/ub_checks.rs:LL:CC
2421
note: inside `main`
2522
--> tests/fail/ptr_swap_nonoverlapping.rs:LL:CC
2623
|

0 commit comments

Comments
 (0)