Per-byte handling for UnsafePinned#4954
Conversation
|
Thank you for contributing to Miri! A reviewer will take a look at your PR, typically within a week or two. |
|
Thanks! However, I think it is too early for this. We currently still honor the Also, this PR treats UnsafeCell and UnsafePinned the same, which I don't think is right. |
|
No worries! I was actually confused by |
As a general rule, please always point out your confusions when submitting a PR. The people reviewing your PRs will thank you. :) |
|
Yes, I will keep that in mind from now on. Thank you for the advice. Again, I apologize for any inconvenience caused. |
|
No worries. :) |
Fixes #4819
This PR ensures that
UnsafePinnedis handled in per-byte way just likeUnsafeCellby adding a check forUnsafePinnedalongside the existingUnsafeCellcheck invisit_value. This makes sure that only the bytes actually covered by theUnsafePinnedopt out and not the entire allocation.