Skip to content

Commit 1769ee1

Browse files
committed
Disable check in copy/copy_nonoverlapping
1 parent aed885a commit 1769ee1

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

library/core/src/intrinsics.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2783,6 +2783,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
27832783
// SAFETY: the safety contract for `copy_nonoverlapping` must be
27842784
// upheld by the caller.
27852785
unsafe {
2786+
/*
27862787
assert_unsafe_precondition!(
27872788
"ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null \
27882789
and the specified memory ranges do not overlap",
@@ -2791,6 +2792,7 @@ pub const unsafe fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: us
27912792
&& is_aligned_and_not_null(dst)
27922793
&& is_nonoverlapping(src, dst, count)
27932794
);
2795+
*/
27942796
copy_nonoverlapping(src, dst, count)
27952797
}
27962798
}
@@ -2878,11 +2880,13 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
28782880

28792881
// SAFETY: the safety contract for `copy` must be upheld by the caller.
28802882
unsafe {
2883+
/*
28812884
assert_unsafe_precondition!(
28822885
"ptr::copy requires that both pointer arguments are aligned and non-null",
28832886
[T](src: *const T, dst: *mut T) =>
28842887
is_aligned_and_not_null(src) && is_aligned_and_not_null(dst)
28852888
);
2889+
*/
28862890
copy(src, dst, count)
28872891
}
28882892
}

0 commit comments

Comments
 (0)