Skip to content

Commit bf3aef2

Browse files
committed
Don't use strong post-condition with Kani just yet
1 parent 47735b2 commit bf3aef2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

library/core/src/ptr/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2275,7 +2275,9 @@ pub(crate) unsafe fn align_offset<T: Sized>(p: *const T, a: usize) -> usize {
22752275
#[safety::requires(m.is_power_of_two())]
22762276
#[safety::requires(x < m)]
22772277
#[safety::requires(x % 2 != 0)]
2278-
#[safety::ensures(|result| wrapping_mul(*result, x) % m == 1)]
2278+
// for Kani (v0.65.0), the below multiplication is too costly to prove
2279+
#[cfg_attr(not(kani),
2280+
safety::ensures(|result| wrapping_mul(*result, x) % m == 1))]
22792281
#[inline]
22802282
const unsafe fn mod_inv(x: usize, m: usize) -> usize {
22812283
/// Multiplicative modular inverse table modulo 2⁴ = 16.

0 commit comments

Comments
 (0)