-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core::ptr::copy
unsafe precondition message is for core::ptr::copy_nonoverlapping
instead
#126400
Comments
firefighterduck
added
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jun 13, 2024
Noratrieb
added
C-bug
Category: This is a bug.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
and removed
A-diagnostics
Area: Messages for errors, warnings, and lints
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
Jun 13, 2024
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Jun 13, 2024
…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
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this issue
Jun 13, 2024
…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
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Jun 14, 2024
Rollup merge of rust-lang#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 rust-lang#126400 . fixes rust-lang#126400
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this issue
Jun 28, 2024
…ilstrieb 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/rust#126400 . fixes #126400
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code
Current output
Desired output
Rationale and extra context
rust/library/core/src/intrinsics.rs
Lines 3046 to 3047 in 921645c
The
assert_unsafe_precondition
message forcore::ptr::copy
is the one forcore::ptr::copy_nonoverlapping
. The precondition itself seems correct, but the message is incorrect in that it not only names the wrong function but also the wrong requirements (i.e.,the specified memory ranges do not overlap
whichcopy
explicitly allows).Other cases
No response
Rust Version
Anything else?
No response
The text was updated successfully, but these errors were encountered: