-
Notifications
You must be signed in to change notification settings - Fork 52
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
Two mut Refs at the same time #48
Comments
|
@Storyyeller Yeah? I was saying that it should be used instead of |
I thought you were saying that you had found a soundness hole. Have you? |
https://gist.github.com/rust-play/05def43b325e835d50cc97a1016c3c6f edit: made code compile on rust stable. the hole is reproducible on nightly ( |
*bump* i guess a simple fix would be to remove as_owner_mut? |
as_owner_mut
creates an additional mut ref to the stored ref, so we end up having two mutable ref at the same time. Why is this allowed? Changing data thru the mut ref should at least invalidate the stored ref (which is achievable by using theinto_owned
method -> mutating the owner -> making an OwningRefMut and mapping it again).http://kimundi.github.io/owning-ref-rs/owning_ref/struct.OwningRefMut.html#method.as_owner_mut
The text was updated successfully, but these errors were encountered: