Skip to content

Commit 3f121b9

Browse files
committed
Auto merge of rust-lang#129488 - saethlin:alignment-precondition, r=workingjubilee
Enable Alignment::new_unchecked precondition check Similar to what happened with rust-lang#126556, I think this has become palatable since rust-lang#126793.
2 parents c6db1ca + 5d98d20 commit 3f121b9

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

library/core/src/ptr/alignment.rs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
use crate::num::NonZero;
2-
#[cfg(debug_assertions)]
32
use crate::ub_checks::assert_unsafe_precondition;
43
use crate::{cmp, fmt, hash, mem, num};
54

@@ -77,7 +76,6 @@ impl Alignment {
7776
#[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")]
7877
#[inline]
7978
pub const unsafe fn new_unchecked(align: usize) -> Self {
80-
#[cfg(debug_assertions)]
8179
assert_unsafe_precondition!(
8280
check_language_ub,
8381
"Alignment::new_unchecked requires a power of two",

0 commit comments

Comments
 (0)