Skip to content

Commit

Permalink
Auto merge of #129488 - saethlin:alignment-precondition, r=workingjub…
Browse files Browse the repository at this point in the history
…ilee

Enable Alignment::new_unchecked precondition check

Similar to what happened with #126556, I think this has become palatable since #126793.
  • Loading branch information
bors committed Aug 25, 2024
2 parents 1a94d83 + 5d98d20 commit 2097689
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions library/core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
@@ -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};

Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 2097689

Please sign in to comment.