-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Clarify vec docs on deallocation (fixes #46879) #46884
Conversation
/// details are very subtle — if you intend to allocate memory using a `Vec` | ||
/// and use it for something else (either to pass to unsafe code, or to build your | ||
/// own memory-backed collection), be sure to deallocate this memory by using | ||
/// `from_raw_parts` to recover the `Vec` and then dropping it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a newb this is confusing. Maybe an explicit inline example would be good.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that might derail the docs; this is about the usage of vec in unsafe contexts and we don't want to go too deep in the weeds there.
(also, this paragraph is related to advanced usage of rust anyway)
“to recover the Vec and then dropping it” sounds weird but I don’t know if “drop it” is grammatically correct either |
📌 Commit 52c28ff has been approved by |
"drop it" is grammatically correct; besides, "drop" is a technical term in
rust so we us it a bit differently :)
…On Dec 21, 2017 4:49 PM, "tinaun" ***@***.***> wrote:
“to recover the Vec and then dropping it” sounds weird but I don’t know if
“drop it” is grammatically correct either
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#46884 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABivSDnMeCQ12c5ge8_NacM-d4SZnS4Aks5tCj6rgaJpZM4RIpAK>
.
|
Clarify vec docs on deallocation (fixes rust-lang#46879) r? @steveklabnik
r? @steveklabnik