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

Incorrect documentation on read_and_drop #31599

Closed
Thiez opened this issue Feb 12, 2016 · 2 comments
Closed

Incorrect documentation on read_and_drop #31599

Thiez opened this issue Feb 12, 2016 · 2 comments

Comments

@Thiez
Copy link
Contributor

Thiez commented Feb 12, 2016

The documentation of the unstable function core::ptr::read_and_drop makes a reference to read_and_zero, but this function does not exist (anymore?). Expressing the semantics of read_and_drop in terms of something that does not exist is unhelpful.

The problem seems to be located here.

I imagine the fix would involve traveling back in time until before read_and_zero was removed and copying its documentation, after correcting for the differences between it and the read_and_drop function.

@steveklabnik

@bluss
Copy link
Member

bluss commented Feb 12, 2016

Filling drop is a temporary "feature" of rust, and in the long run this function will not be needed once the in-struct drop flags are gone. In anticipation of this improvement, it would be best to not write any code that relies on read_and_drop.

Edit: Well maybe that's exactly what to have in the docs..

@Thiez
Copy link
Contributor Author

Thiez commented Feb 12, 2016

I'm not using that function, I was merely browsing the docs and noticed the documentation was wrong. I would expect the documentation of functions to be correct even if they are unstable and scheduled for removal, unless the removal is scheduled for the immediate future.

steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 12, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 13, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 14, 2016
steveklabnik added a commit to steveklabnik/rust that referenced this issue Feb 14, 2016
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

No branches or pull requests

3 participants