Skip to content

Commit 6dab042

Browse files
committed
Fix syntax error, naming
1 parent 7603984 commit 6dab042

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

library/core/src/num/nonzero.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ where
454454
#[inline]
455455
#[requires({
456456
let size = core::mem::size_of::<T>();
457-
let ptr = &n as *const T as *const u8;
457+
let ptr = n as *const T as *const u8;
458458
let slice = unsafe { core::slice::from_raw_parts(ptr, size) };
459459
!slice.iter().all(|&byte| byte == 0)
460460
})]
@@ -2431,7 +2431,7 @@ mod verify {
24312431

24322432
macro_rules! nonzero_check_from_mut_unchecked {
24332433
($t:ty, $nonzero_type:ty, $harness_name:ident) => {
2434-
#[kani::proof_for_contract(NonZero::from_mut_unchecked)]
2434+
#[kani::proof_for_contract(NonZero<$t>::from_mut_unchecked)]
24352435
pub fn $harness_name() {
24362436
let mut x: $t = kani::any();
24372437
unsafe {
@@ -2671,8 +2671,8 @@ mod verify {
26712671

26722672
macro_rules! check_mul_unchecked_small{
26732673
($t:ty, $nonzero_type:ty, $nonzero_check_mul_for:ident) => {
2674-
#[kani::proof_for_contract(<$t>::unchecked_mul)]
2675-
pub fn $nonzero_check_mul_for() {
2674+
#[kani::proof_for_contract(NonZero<$t>::unchecked_mul)]
2675+
pub fn $nonzero_check_unchecked_mul_for() {
26762676
let x: $nonzero_type = kani::any();
26772677
let y: $nonzero_type = kani::any();
26782678

@@ -2685,16 +2685,16 @@ mod verify {
26852685

26862686
macro_rules! check_mul_unchecked_intervals{
26872687
($t:ty, $nonzero_type:ty, $nonzero_check_mul_for:ident, $min:expr, $max:expr) => {
2688-
#[kani::proof_for_contract(<$t>::unchecked_mul)]
2688+
#[kani::proof_for_contract(NonZero<$t>::unchecked_mul)]
26892689
pub fn $nonzero_check_mul_for() {
26902690
let x = kani::any::<$t>();
2691-
let y = kani::any::<$t>();
2691+
let y = kani::any::<$t>();
26922692

2693-
kani::assume(x != 0 && x >= $min && x <= $max);
2694-
kani::assume(y != 0 && y >= $min && y <= $max);
2693+
kani::assume(x != 0 && x >= $min && x <= $max);
2694+
kani::assume(y != 0 && y >= $min && y <= $max);
26952695

2696-
let x = <$nonzero_type>::new(x).unwrap();
2697-
let y = <$nonzero_type>::new(y).unwrap();
2696+
let x = <$nonzero_type>::new(x).unwrap();
2697+
let y = <$nonzero_type>::new(y).unwrap();
26982698

26992699
unsafe {
27002700
x.unchecked_mul(y);
@@ -2761,7 +2761,7 @@ mod verify {
27612761

27622762
macro_rules! nonzero_check_add {
27632763
($t:ty, $nonzero_type:ty, $nonzero_check_unchecked_add_for:ident) => {
2764-
#[kani::proof_for_contract(<$nonzero_type>::unchecked_add)]
2764+
#[kani::proof_for_contract(NonZero<$t>::unchecked_add)]
27652765
pub fn $nonzero_check_unchecked_add_for() {
27662766
let x: $nonzero_type = kani::any();
27672767
let y: $t = kani::any();

0 commit comments

Comments
 (0)