From 5d98d2052923c116a0493528d41d656e9b29c92f Mon Sep 17 00:00:00 2001 From: Ben Kimock Date: Fri, 23 Aug 2024 18:26:45 -0400 Subject: [PATCH] Enable Alignment::new_unchecked precondition check --- library/core/src/ptr/alignment.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs index 68fce3960c78c..19fe03d57cc0a 100644 --- a/library/core/src/ptr/alignment.rs +++ b/library/core/src/ptr/alignment.rs @@ -1,5 +1,4 @@ use crate::num::NonZero; -#[cfg(debug_assertions)] use crate::ub_checks::assert_unsafe_precondition; use crate::{cmp, fmt, hash, mem, num}; @@ -77,7 +76,6 @@ impl Alignment { #[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")] #[inline] pub const unsafe fn new_unchecked(align: usize) -> Self { - #[cfg(debug_assertions)] assert_unsafe_precondition!( check_language_ub, "Alignment::new_unchecked requires a power of two",