Skip to content

Commit 55d3538

Browse files
kornelskigitbot
authored and
gitbot
committed
Make ub_check message clear that it's not an assert
1 parent cb0517f commit 55d3538

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

core/src/ub_checks.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ macro_rules! assert_unsafe_precondition {
6565
#[rustc_nounwind]
6666
const fn precondition_check($($name:$ty),*) {
6767
if !$e {
68-
::core::panicking::panic_nounwind(
69-
concat!("unsafe precondition(s) violated: ", $message)
70-
);
68+
::core::panicking::panic_nounwind(concat!("unsafe precondition(s) violated: ", $message,
69+
"\n\nThis indicates a bug in the program. \
70+
This Undefined Behavior check is optional, and cannot be relied on for safety."));
7171
}
7272
}
7373

0 commit comments

Comments
 (0)