Skip to content

Commit f365bea

Browse files
committed
Fix Verus: remove int bitwise ops in cpu_mask spec (int has no spec_bitand)
1 parent 4a5f135 commit f365bea

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/cpu_mask.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ pub struct CpuMaskResult {
5353
/// Spec-level power-of-2 check: exactly one bit set.
5454
/// A value `m` has exactly one bit iff `m != 0 && (m & (m - 1)) == 0`.
5555
pub open spec fn is_power_of_two(m: u32) -> bool {
56-
m != 0 && (m as int) & ((m as int) - 1) == 0
56+
m != 0 && (m & (m - 1)) == 0
5757
}
5858

5959
/// Spec-level mask computation.
6060
pub open spec fn compute_mask(current: u32, enable: u32, disable: u32) -> u32 {
61-
((current | enable) & !disable) as u32
61+
(current | enable) & !disable
6262
}
6363

6464
// ------------------------------------------------------------------

0 commit comments

Comments
 (0)