-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Tracking Issue for Vec::split_at_spare_mut #81944
Comments
Interesting! I personally use |
Hm, why there are no unresolved questions yet? It doesn't seem that the questions from the implementation PR were resolved:
|
@WaffleLapkin I just missed those questions that came up after the PR approval is all 🙂 They're in the tracking issue now. |
That is not true: |
@RalfJung ohhh. I haven't thought of this. Then I guess the question "do we need both?" is resolved: yes.
Current implementation just calls |
Well, that doesn't count as "careful" I guess. ;) |
I guess so 😅 I'll try to make the implementation more careful (revert it?) and make a PR :) |
…lfJung Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation The implementation was changed in rust-lang#79015. Later it was [pointed out](rust-lang#81944 (comment)) that the implementation invalidates pointers to the buffer (initialized elements) by creating a unique reference to the buffer. This PR reverts the implementation. r? `@RalfJung`
…lfJung Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation The implementation was changed in rust-lang#79015. Later it was [pointed out](rust-lang#81944 (comment)) that the implementation invalidates pointers to the buffer (initialized elements) by creating a unique reference to the buffer. This PR reverts the implementation. r? ``@RalfJung``
…lfJung Revert `Vec::spare_capacity_mut` impl to prevent pointers invalidation The implementation was changed in rust-lang#79015. Later it was [pointed out](rust-lang#81944 (comment)) that the implementation invalidates pointers to the buffer (initialized elements) by creating a unique reference to the buffer. This PR reverts the implementation. r? ```@RalfJung```
Oops, what I commented here is far more relevant to |
Feature gate:
#![feature(vec_split_at_spare)]
This is a tracking issue for
Vec::split_at_spare_mut
, which is used as the basis for a few methods internally to give a slice pointing to the initialized portion of theVec
and a slice ofMaybeUninit
pointing to the uninitialized portion.Public API
Steps / History
Unresolved Questions
split_at_spare_mut
doesn't seem like an intuitive nameVec::spare_capacity_mut
? Any usecase ofVec::spare_capacity_mut
can be replaced withVec::split_at_spare_mut
(but not vise-versa):edit:
spare_capacity_mut
has been stabilised now in Stabilize vec_spare_capacity #93016 so deprecating it is probably not an optionThe text was updated successfully, but these errors were encountered: