Skip to content

Commit

Permalink
Combine requires clauses to avoid spurious overflow error
Browse files Browse the repository at this point in the history
  • Loading branch information
tautschnig committed Jul 23, 2024
1 parent 44824f1 commit 25c9cca
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/core/src/ptr/alignment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@ impl Alignment {
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
#[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")]
#[inline]
#[requires(align > 0)]
#[requires((align & (align - 1)) == 0)]
#[requires(align > 0 && (align & (align - 1)) == 0)]
pub const unsafe fn new_unchecked(align: usize) -> Self {
#[cfg(debug_assertions)]
assert_unsafe_precondition!(
Expand Down

0 comments on commit 25c9cca

Please sign in to comment.