Rollup merge of #126402 - firefighterduck:fix-unsafe-precon-copy, r=Nilstrieb

Fix wrong `assert_unsafe_precondition` message for `core::ptr::copy`

A small fix in the `assert_unsafe_precondition` message for `core::ptr::copy` as described by https://github.com/rust-lang/rust/issues/126400 .

fixes #126400
This commit is contained in:
Matthias Krüger 2024-06-13 22:55:49 +02:00 committed by GitHub
commit 3494ea1818
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3043,8 +3043,7 @@ pub const unsafe fn copy<T>(src: *const T, dst: *mut T, count: usize) {
unsafe {
ub_checks::assert_unsafe_precondition!(
check_language_ub,
"ptr::copy_nonoverlapping requires that both pointer arguments are aligned and non-null \
and the specified memory ranges do not overlap",
"ptr::copy requires that both pointer arguments are aligned and non-null",
(
src: *const () = src as *const (),
dst: *mut () = dst as *mut (),