Skip to content

Explain drop a bit more #30696

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

Merged
merged 1 commit into from
Jan 19, 2016
Merged

Explain drop a bit more #30696

merged 1 commit into from
Jan 19, 2016

Conversation

steveklabnik
Copy link
Member

Fixes #30655

@rust-highfive
Copy link
Contributor

r? @brson

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

@@ -95,6 +95,16 @@ use fmt;
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Drop {
/// A method called when the value goes out of scope.
///
/// When this method has been called, `self` has not yet been deallocated.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the tense in the first clause makes things a bit ambiguous. How about something like "Before this method is called, self has not yet been deallocated."

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, I'm not sure it even makes sense to use the word "deallocated," since a number of Drop impls don't have anything to do with allocation. I think this description should probably just talk about it being invalid (or some other word) to access self after drop has been called.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah I mean, I felt like it was a little weird because &mut is always valid, but @durka felt differently.

@steveklabnik
Copy link
Member Author

I saw this patch as a quick improvement, not the final, super-awesome docs. I have some stuff that's a bit higher priority than this right now.

@brson do you think it's better to

  1. do a little bit of tweaks, maybe around what you said, and merge
  2. drop this patch until I have the time to do my usual full, intense treatment

@brson
Copy link
Contributor

brson commented Jan 12, 2016

It's an improvement on what's there so r=me

@steveklabnik
Copy link
Member Author

@bors: r=brson rollup

Okay! I will bump this up on my priority list a bit as well.

@bors
Copy link
Collaborator

bors commented Jan 19, 2016

📌 Commit 3385fba has been approved by brson

@bors
Copy link
Collaborator

bors commented Jan 19, 2016

⌛ Testing commit 3385fba with merge f8c2d57...

bors added a commit that referenced this pull request Jan 19, 2016
@bors
Copy link
Collaborator

bors commented Jan 19, 2016

💔 Test failed - auto-win-gnu-64-nopt-t

@alexcrichton
Copy link
Member

@bors: retry

@bors bors merged commit 3385fba into rust-lang:master Jan 19, 2016
@steveklabnik steveklabnik deleted the gh30655 branch June 19, 2016 20:30
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.

7 participants