Skip to content

Commit b6e185e

Browse files
authored
Remove unsafe operation
1 parent 4c07dcd commit b6e185e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library/core/src/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3540,7 +3540,7 @@ fn check_copy_untyped<T>(src: *const T, dst: *mut T, count: usize) -> bool {
35403540
let byte = kani::any_where(|sz: &usize| *sz < size_of::<T>());
35413541
let elem = kani::any_where(|val: &usize| *val < count);
35423542
let src_data = src as *const u8;
3543-
let dst_data = unsafe { dst.add(elem) } as *const u8;
3543+
let dst_data = dst.wrapping_add(elem) as *const u8;
35443544
ub_checks::can_dereference(unsafe { src_data.add(byte) })
35453545
== ub_checks::can_dereference(unsafe { dst_data.add(byte) })
35463546
} else {

0 commit comments

Comments
 (0)