Skip to content

Commit 267fa99

Browse files
committed
Use .0 instead of .as_usize
1 parent a1bbbbb commit 267fa99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/core/src/ptr/alignment.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ use crate::{cmp, fmt, hash, mem, num};
1616
#[unstable(feature = "ptr_alignment_type", issue = "102070")]
1717
#[derive(Copy, Clone, PartialEq, Eq)]
1818
#[repr(transparent)]
19-
#[invariant(self.as_usize().is_power_of_two())]
19+
// uses .0 instead of .as_usize() to permit proving as_usize so that its proof does not itself use
20+
// as_usize
21+
#[invariant((self.0 as usize).is_power_of_two())]
2022
pub struct Alignment(AlignmentEnum);
2123

2224
// Alignment is `repr(usize)`, but via extra steps.

0 commit comments

Comments
 (0)