]> git.lizzy.rs Git - rust.git/blobdiff - library/core/src/ptr/alignment.rs
Auto merge of #103299 - nikic:usub-overflow, r=wesleywiser
[rust.git] / library / core / src / ptr / alignment.rs
index 846efbc4ebf6c5971c8df98aacf132e953d062ae..1390e09dd96aec4c74b785ab6b26a8a0353812ac 100644 (file)
@@ -76,7 +76,12 @@ pub const fn new(align: usize) -> Option<Self> {
     #[inline]
     pub const unsafe fn new_unchecked(align: usize) -> Self {
         // SAFETY: Precondition passed to the caller.
-        unsafe { assert_unsafe_precondition!((align: usize) => align.is_power_of_two()) };
+        unsafe {
+            assert_unsafe_precondition!(
+               "Alignment::new_unchecked requires a power of two",
+                (align: usize) => align.is_power_of_two()
+            )
+        };
 
         // SAFETY: By precondition, this must be a power of two, and
         // our variants encompass all possible powers of two.