Skip to content

Commit 3e30b2c

Browse files
committed
fix rapx annotation for ptr::add
1 parent 414b692 commit 3e30b2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/ptr/mut_ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,8 +1043,8 @@ impl<T: PointeeSized> *mut T {
10431043
// Otherwise, for non-unit types, ensure that `self` and `result` point to the same allocated object,
10441044
// verifying that the result remains within the same allocation as `self`.
10451045
#[ensures(|result| (core::mem::size_of::<T>() == 0) || core::ub_checks::same_allocation(self as *const T, *result as *const T))]
1046-
#[cfg_attr(rapx, safety {InBound(self, T, 1)})]
1047-
#[cfg_attr(rapx, safety {ValidNum(count)})]
1046+
#[cfg_attr(rapx, safety {InBound(self, T, count)})]
1047+
#[cfg_attr(rapx, safety {ValidNum(count * size_of(T) <= isize::MAX)})]
10481048
pub const unsafe fn add(self, count: usize) -> Self
10491049
where
10501050
T: Sized,

0 commit comments

Comments
 (0)