Skip to content
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

Check against the stacked borrows model #4

Open
jix opened this issue Jun 13, 2019 · 1 comment
Open

Check against the stacked borrows model #4

jix opened this issue Jun 13, 2019 · 1 comment

Comments

@jix
Copy link
Owner

jix commented Jun 13, 2019

Make sure that the way raw pointers are used to implement this crate makes it impossible to violate the stacked borrows model using the safe API.

@jix
Copy link
Owner Author

jix commented May 7, 2020

I now believe that the current implementation of partial_ref runs into undefined behavior. It uses temporary references to construct raw pointer-to-field values, those temporary references can alias in a way that is not allowed. AFAICT this works in practice and is done in many other crates as there currently is no other way to do this in stable rust.

There is an accepted RFC rust-lang/rfcs#2582 that would allow to do this properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant