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

Clarify handling of src in ptr::write #40333

Merged
merged 1 commit into from
Mar 9, 2017
Merged

Conversation

tbu-
Copy link
Contributor

@tbu- tbu- commented Mar 7, 2017

Fixes #39733.

@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@tbu-
Copy link
Contributor Author

tbu- commented Mar 7, 2017

CC @niconii

@alexcrichton
Copy link
Member

@bors: r+ rollup

@bors
Copy link
Contributor

bors commented Mar 8, 2017

📌 Commit 025bf95 has been approved by alexcrichton

@nagisa
Copy link
Member

nagisa commented Mar 8, 2017

The description seems overly contrived to me. I had to reread it multiple times and look at the issue to understand what the paragraph is getting at.

@tbu-
Copy link
Contributor Author

tbu- commented Mar 8, 2017

@nagisa Mh. :/

I know this is just a single sentence but can you pinpoint why or what part caused you to reread that sentence multiple times?

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 8, 2017
@niconii
Copy link
Contributor

niconii commented Mar 8, 2017

@tbu- I also think there are a few ways the wording could be improved.

  • Saying "it does not immediately drop the contents of src" seems potentially confusing, since "it" here means "ptr::write", making it sound like ptr::write itself could drop src at some later point.

  • Talking about "the contents of src" to parallel "the contents of dst" is also not great given dst is a pointer whereas src is a value passed directly into the function.

  • The thing being referred to by "it" changes from "ptr::write" to "the contents of src" somewhat abruptly.

Personally, I would reword it like this:

In addition, it does not drop src. Semantically, src is moved into the location pointed to by dst.

@nagisa
Copy link
Member

nagisa commented Mar 8, 2017 via email

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Mar 8, 2017
arielb1 pushed a commit to arielb1/rust that referenced this pull request Mar 8, 2017
bors added a commit that referenced this pull request Mar 9, 2017
@bors bors merged commit 025bf95 into rust-lang:master Mar 9, 2017
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.

6 participants