-
Notifications
You must be signed in to change notification settings - Fork 320
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
-Zmiri-tag-raw-pointers
causes a simple copy_nonoverlapping
to fail
#2052
Labels
C-question
Category: Not necessarily a bug, but someone asking for support
Comments
RalfJung
added
the
C-question
Category: Not necessarily a bug, but someone asking for support
label
Apr 6, 2022
Yeah, when you call See rust-lang/unsafe-code-guidelines#133 for the underlying issue. I am going to close the Miri side of this. The fix is to not use any references when you do raw ptr shenanigans: let mut x: [u64; 4] = [0, 1, 2, 3];
let ptr = x.as_mut_ptr();
// Reference-free zone begins here.
ptr::copy_nonoverlapping(ptr, ptr.add(2), 2); |
This comment was marked as resolved.
This comment was marked as resolved.
Ok, kind of makes sense |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was trying out
-Zmiri-strict-provenance
on my library https://github.com/AaronKutch/awint and it lead to tests failing. I looked at the other things strict provenance turns on, and the problems start with-Zmiri-tag-raw-pointers
. I think I have minimized it to:which fails with
The text was updated successfully, but these errors were encountered: