-
Notifications
You must be signed in to change notification settings - Fork 347
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
Confusing Stacked Borrows error with #![feature(ptr_metadata)] #2087
Comments
The |
That's intersting. Thanks for the response and the links, it helped clear things up. If I stay in raw pointer land and not create the |
When entering As indicated in rust-lang/unsafe-code-guidelines#134 stacked borrows may in the future be relaxed to allow your code. At the very least I'm not aware of the current lowering to LLVM ir having UB for this. |
This mostly makes sense to me. I guess my last question might be more about the implementation details of Miri.
I understand that when using I understand why that would make sense, but not how Miri manages to come to that conclusion, since it seems as though at that point the type information of Anyways, thanks for clearing things up. Confusion has been (mostly) lifted. |
Yes, Miri does the equivalent of |
Sorry for the vague title.
I wasn't sure if this code was valid so I ran it through Miri.
This however led to even more confusion.
It seems as though I can convince Miri that this code is fine, by first calling a function with no observable side-effect.
I would be very thankful for an explanation (and even more thankful if someone want's to tell me if this code is fine 😃)
The text was updated successfully, but these errors were encountered: