Skip to content

Commit 1af7483

Browse files
thanhnguyen-awsCarolyn Zech
andauthored
Update library/core/src/ptr/non_null.rs
Co-authored-by: Carolyn Zech <[email protected]>
1 parent 21b54b0 commit 1af7483

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/ptr/non_null.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1236,7 +1236,7 @@ impl<T: ?Sized> NonNull<T> {
12361236
#[rustc_const_stable(feature = "const_ptr_write", since = "1.83.0")]
12371237
#[cfg_attr(kani, kani::modifies(crate::ptr::slice_from_raw_parts(self.as_ptr(), count)))]
12381238
#[requires(
1239-
count.checked_mul(core::mem::size_of::<T>() as usize).is_some_and(|x| x.wrapping_add(self.as_ptr() as usize) <= isize::MAX as usize) &&
1239+
count.checked_mul(core::mem::size_of::<T>() as usize).is_some_and(|byte_count| byte_count.wrapping_add(self.as_ptr() as usize) <= isize::MAX as usize) &&
12401240
ub_checks::can_write(core::ptr::slice_from_raw_parts_mut(self.as_ptr(), count))
12411241
)]
12421242
#[ensures(|_|

0 commit comments

Comments
 (0)