Clarify vec docs on deallocation (fixes #46879)#46884
Merged
bors merged 1 commit intorust-lang:masterfrom Dec 22, 2017
Merged
Conversation
kjeremy
reviewed
Dec 20, 2017
| /// 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. |
Contributor
There was a problem hiding this comment.
As a newb this is confusing. Maybe an explicit inline example would be good.
Member
Author
There was a problem hiding this comment.
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)
Contributor
|
“to recover the Vec and then dropping it” sounds weird but I don’t know if “drop it” is grammatically correct either |
steveklabnik
approved these changes
Dec 21, 2017
Contributor
Collaborator
|
📌 Commit 52c28ff has been approved by |
Member
Author
|
"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>
.
|
kennytm
added a commit
to kennytm/rust
that referenced
this pull request
Dec 21, 2017
Clarify vec docs on deallocation (fixes rust-lang#46879) r? @steveklabnik
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r? @steveklabnik