You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #136750 - kornelski:ub-bug, r=saethlin
Make ub_check message clear that it's not an assert
I've seen a user assume that their unsound code was *safe*, because ub_check prevented the program from performing the unsafe operation.
This PR makes the panic message clearer that ub_check is a bug detector, not run-time safety protection.
Copy file name to clipboardExpand all lines: tests/fail/ptr_swap_nonoverlapping.stderr
+2
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
2
2
thread 'main' panicked at RUSTLIB/core/src/panicking.rs:LL:CC:
3
3
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
4
+
5
+
This indicates a bug in the program. This Undefined Behavior check is optional, and cannot be relied on for safety.
4
6
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
5
7
note: in Miri, you may have to set `MIRIFLAGS=-Zmiri-env-forward=RUST_BACKTRACE` for the environment variable to have an effect
0 commit comments