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 2acb995 + 891f00c commit 369fa55
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions 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 369fa55

Please sign in to comment.