Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2cb786e

Browse files
committedFeb 9, 2025·
Include arguments to the precondition check in failure messages
1 parent 124cc92 commit 2cb786e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+153
-75
lines changed
 

‎library/core/src/alloc/layout.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ impl Layout {
130130
assert_unsafe_precondition!(
131131
check_library_ub,
132132
"Layout::from_size_align_unchecked requires that align is a power of 2 \
133-
and the rounded-up allocation size does not exceed isize::MAX",
133+
and the rounded-up allocation size does not exceed isize::MAX (size:{size}, align:{align})",
134134
(
135135
size: usize = size,
136136
align: usize = align,

‎library/core/src/ascii/ascii_char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ impl AsciiChar {
506506
pub const unsafe fn digit_unchecked(d: u8) -> Self {
507507
assert_unsafe_precondition!(
508508
check_language_ub,
509-
"`ascii::Char::digit_unchecked` input cannot exceed 9.",
509+
"`ascii::Char::digit_unchecked` input cannot exceed 9. (d:{d})",
510510
(d: u8 = d) => d < 10
511511
);
512512

0 commit comments

Comments
 (0)
Please sign in to comment.