-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Improve ptr::read docs #21989
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
Improve ptr::read docs #21989
Conversation
@bors r+ ccb5 rollup |
How about "...leaves the memory in |
With non-zeroing drop, this would be an accurate description of a normal drop, no? |
@kmcallister it doesn't run the destructor |
The value is memcpy'd onto the stack and ignored, so the destructor is run there. Something like |
Fair enough, I see what you mean. I feel like the idiom of discarding |
I'm happy to adapt this to whatever everyone decides is best :) |
How about "Copies the value behind the pointer regardless of whether it is Copy" or something to that effect. |
Fixes #21491
r? @kmcallister @gankro