From 581e171773a0e4bf398d4b7df0e30a7aae627f0b Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Fri, 9 Feb 2024 20:07:42 -0500 Subject: Convert debug_assert_nounwind to intrinsics::debug_assertions --- library/core/src/ptr/alignment.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'library/core/src/ptr/alignment.rs') diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs index d2422bb80ae..6dfecb5a826 100644 --- a/library/core/src/ptr/alignment.rs +++ b/library/core/src/ptr/alignment.rs @@ -76,6 +76,7 @@ impl Alignment { #[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] pub const unsafe fn new_unchecked(align: usize) -> Self { + #[cfg(debug_assertions)] crate::panic::debug_assert_nounwind!( align.is_power_of_two(), "Alignment::new_unchecked requires a power of two" -- cgit 1.4.1-3-g733a5