Skip to content

Commit

Permalink
Rollup merge of rust-lang#126402 - firefighterduck:fix-unsafe-precon-…
Browse files Browse the repository at this point in the history
…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 rust-lang#126400 .

fixes rust-lang#126400
  • Loading branch information
matthiaskrgr authored Jun 13, 2024
2 parents a67979b + 0cc099b commit 650935e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 (),
Expand Down

0 comments on commit 650935e

Please sign in to comment.