Skip to content

Commit 31bed92

Browse files
committed
Use .0 instead of .as_usize
1 parent a1bbbbb commit 31bed92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/ptr/alignment.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ 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+
#[invariant(self.0.is_power_of_two())] // uses .0 instead of .as_usize() to permit proving as_usize
2020
pub struct Alignment(AlignmentEnum);
2121

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

0 commit comments

Comments
 (0)