Skip to content
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 {String,Vec}::from_raw_parts documentation #34884

Merged
merged 2 commits into from Jul 19, 2016

Conversation

shepmaster
Copy link
Member

No description provided.

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@@ -701,6 +701,13 @@ impl String {
/// Violating these may cause problems like corrupting the allocator's
/// internal datastructures.
///
/// The ownership of `ptr` is effectively transferred to the
/// `String` and the memory referred to by the pointer will be
/// deallocated when the `String` goes out of scope. Ensure that
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should say “dropped” instead “goes out of scope”. Going out of scope does not necessarily imply the drop (we do not guarantee that, for example) and its the dropping which handles the deallocation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

/// deallocated when the `String` is dropped. Ensure that
/// nothing else uses the pointer after calling this
/// function. Calling this function multiple times with the same
/// pointer is an error.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github overzealously hid the unresolved previous conversation

@nagisa
Copy link
Member

nagisa commented Jul 17, 2016

Seems good to me.

r=me.

@nagisa
Copy link
Member

nagisa commented Jul 17, 2016

Oh, eh, I wonder whether the added paragraph is best under the Safety section. Maybe it would be better to add it just before it (right after the short description)?

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Jul 17, 2016

After discussion on IRC:

@bors: r=nagisa rollup

Thanks @shepmaster!

@bors
Copy link
Contributor

bors commented Jul 17, 2016

📌 Commit 661187a has been approved by @nagisa

@bors
Copy link
Contributor

bors commented Jul 17, 2016

💡 This pull request was already approved, no need to approve it again.

@bors
Copy link
Contributor

bors commented Jul 17, 2016

📌 Commit 661187a has been approved by @nagisa

sanxiyn added a commit to sanxiyn/rust that referenced this pull request Jul 18, 2016
…agisa

Improve {String,Vec}::from_raw_parts documentation
bors added a commit that referenced this pull request Jul 19, 2016
Rollup of 5 pull requests

- Successful merges: #34807, #34853, #34875, #34884, #34889
- Failed merges:
@bors bors merged commit 661187a into rust-lang:master Jul 19, 2016
@shepmaster shepmaster deleted the from_raw_parts_doc branch July 19, 2016 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants