-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ptr::read docs are bogus #21491
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
Comments
I actually recently wrote this 😓 I think maybe this should instead say "without moving it"? |
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Feb 6, 2015
Manishearth
added a commit
to Manishearth/rust
that referenced
this issue
Feb 6, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
But in fact this code does run the destructor:
It's not clear what "without dropping it" means. I suspect the point is that it won't mark the target (hence
*const T
) as destroyed, from an era when this was more of a dynamic notion than today. But at any rate, the docs should reflect reality. As far as I know this is the way to explicitly run a destructor in Rust — a nice duality becauseptr::write
is the "placement new" for uninitialized memory.The text was updated successfully, but these errors were encountered: