Partially stabilize box_vec_non_null#157226
Conversation
|
An additional issue: Should EDIT: It could also be |
|
Just cataloguing the similar methods from rustdoc:
from_parts/into_parts: (proposed)
I think that The only other methods in libstd that use the term "parts" are Would say that maybe we should not label any "parts" as canonical for now at least, since it's not clear what version would be best to use. |
|
cc @rust-lang/opsem - is there a reason on your end to make |
|
@joshtriplett has proposed to merge this. The next step is review by the rest of the tagged team members: Concerns:
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. |
|
Which exact function is this about? EDIT: I assume Though given that the returned pointer is meant to be mutable, my personal preference would be |
|
I like these. I'm concerned about the @rfcbot concern |
|
Just to confirm: T-libs-api has agreed to stabilize with the name @BurntSushi The reason the |
|
@theemathas Not sure if anything has changed or if it has been discussed. That comment is from almost 2 years ago though. @joshtriplett Thoughts on the naming here? |
I think we have generally agreed in the past that non-null is |
|
To resolve the |
|
@nia-e I assume this also means:
|
This makes the `dangling_pointers_from_temporaries` lint work with it.
24e92dc to
a18a972
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
box_vec_non_nullbox_vec_non_null
|
I've updated the PR and the PR description, so |
|
@BurntSushi @joshtriplett May the concerns be resolved? |
|
I don't think my concern has been addressed. Like, I also don't think these routines are used enough to warrant the shorter name. |
Closes #130364
r? libs-api
What's being stabilized
The following is being stabilized in this PR:
Note that
Vec::from_partsandVec::into_partsremain const-unstable behind theconst_heapfeature (likeVec::from_raw_partsandVec::into_raw_parts).The following APIs remain gated behind
allocator_apiThe following API is split into a new unstable feature in #157843, and remains unstable:
Implementation History
Most of this feature was ACP'ed in rust-lang/libs-team#418, and implemented in #130061.
Vec::as_non_nullwas ACP'ed separately in rust-lang/libs-team#440, and implemented in #130624.Potential issues
Vec::from_partsandVec::into_partsbe the name used for this? Or should those names be used for functions that take/returnBox<[MaybeUninit<T>]>? (Raised at Tracking Issue forbox_vec_non_null#130364 (comment))non_nullornonnull? (Raised at Tracking Issue forbox_vec_non_null#130364 (comment). Seemem::Alignment: Naming the-> NonZero<usize>method. #154237 (comment).)Veccollide with anything via autoderef?