-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Stabilize Vec::leak as a method #74605
Conversation
r? @cramertj (rust_highfive has picked a reviewer for you, use r? to override) |
@rfcbot fcp merge |
Team member @SimonSapin has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
☔ The latest upstream changes (presumably #73265) made this pull request unmergeable. Please resolve the merge conflicts. |
The reason for `Box::leak` not to be a method (`Deref` to an arbitrary `T` which might have its own, different `leak` method) does not apply.
I’ll leave my comment here instead of the tracking issue because this is where the FCP is. Is one of our main goals for let (slice, cap) = vec.leak();
let vec = unsafe { Vec::from_raw_parts(slice.as_mut_ptr(), slice.len(), cap) }; so that you have all the info you need to reconstitute the |
If we want to leave |
@KodrAus The point of |
@Amanieu Right. I think my question is easily answered by an orthogonal |
We already have |
Yes, we’ve been talking on that thread about I do think the docs for |
Not dropped in the |
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
@bors r+ |
📌 Commit 7d759f5 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Closes #62195
The signature is changed to a method rather than an associated function:
The reason for
Box::leak
not to be a method (Deref
to an arbitraryT
which might have its own, differentleak
method) does not apply.