Skip to content

Commit 25c9cca

Browse files
committed
Combine requires clauses to avoid spurious overflow error
1 parent 44824f1 commit 25c9cca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

library/core/src/ptr/alignment.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ impl Alignment {
8080
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
8181
#[rustc_const_unstable(feature = "ptr_alignment_type", issue = "102070")]
8282
#[inline]
83-
#[requires(align > 0)]
84-
#[requires((align & (align - 1)) == 0)]
83+
#[requires(align > 0 && (align & (align - 1)) == 0)]
8584
pub const unsafe fn new_unchecked(align: usize) -> Self {
8685
#[cfg(debug_assertions)]
8786
assert_unsafe_precondition!(

0 commit comments

Comments
 (0)