-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Add ManuallyDrop::take #55421
Add ManuallyDrop::take #55421
Conversation
r? @kennytm (rust_highfive has picked a reviewer for you, use r? to override) |
Tracking issue currently points to this PR, that will need to be updated if this is accepted to be merged. cc @scottmcm |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some documentation issues otherwise LGTM 🙂. cc @scottmcm.
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
Thanks for the ccs, but I don't have anything to add 😅 Seems logical to me. |
r=me after squashing everything down to 1 commit. cc @rust-lang/libs and @rust-lang/wg-unsafe-code-guidelines in case there's any problems caused by this function. |
Squashed. |
@bors r+ rollup |
📌 Commit 0757c0f has been approved by |
Add ManuallyDrop::take Tracking issue: rust-lang#55422 Proposed in this form in https://internals.rust-lang.org/t/mini-rfc-manuallydrop-take/8679, see that thread for some history. A small convenience wrapper for `ManuallyDrop` that makes a pattern (taking ownership of the contained data in drop) more obvious.
Rollup of 11 pull requests Successful merges: - #55148 (Implement FromStr for PathBuf) - #55185 (path suggestions in Rust 2018 should point out the change in semantics) - #55191 (Fix sub-variant doc display) - #55199 (Impl items have generics) - #55244 (Don't rerun MIR passes when inlining) - #55252 (Add MaybeUninit::new) - #55257 (Allow extern statics with an extern type) - #55389 (Remove unnecessary mut in iterator.find_map documentation example, R…) - #55406 (Update string.rs) - #55412 (Fix an ICE in the min_const_fn analysis) - #55421 (Add ManuallyDrop::take)
I expected the definition to be |
@SimonSapin I think it ended up this way because the code snippit on IRLO that became this was written as an external function. The alternative implementation sounds good too. |
Tracking issue: #55422
Proposed in this form in https://internals.rust-lang.org/t/mini-rfc-manuallydrop-take/8679,
see that thread for some history.
A small convenience wrapper for
ManuallyDrop
that makes a pattern (taking ownership of the contained data in drop) more obvious.