Make IoSlice and IoSliceMut methods unstably const by thaliaarchi · Pull Request #144090 · rust-lang/rust (original) (raw)
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
This enables constructing IoSlice and IoSliceMut in const contexts without users needing to break the platform abstraction by doing the cast themselves. This is useful for statics.
Since all current and plausible future platforms use simple slice-like structs, this should not impose a burden when adding a new platform with a different struct.
r? @ibraheemdev
rustbot has assigned @ibraheemdev.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.
Use r? to explicitly pick a reviewer
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the library team, which will review and decide on the PR/issue.
labels
If this looks good, I'll open a tracking issue and link it.
rustbot added the T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
label
@BurntSushi Friendly ping. Would you mind taking a look at this?
This seems fine; if we wind up with an obscure platform for which the vector type can't be constructed at comptime for some reason, we would probably use the unsupported fallback instead.
Nominated.
tgross35 added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
For after discussion and updates,
r? libs
This PR was rebased onto a different master 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.
Relevant to the library team, which will review and decide on the PR/issue.
Nominated for discussion during a libs-api team meeting.
labels
FCP since this requires that any iovec-like structure is always const-constructible without calling any system API functions. This is already the case for unix and Windows.
@rfcbot merge
Team member @Amanieu 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.
@rustbot ready
(I neglected to remove the tag after resolving review feedback)
rustbot removed the S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
label
🔔 This is now entering its final comment period, as per the review above. 🔔
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.
This will be merged soon.
r? tgross35
@bors r+ rollup
📌 Commit 3cf5b88 has been approved by tgross35
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Zalathar added a commit to Zalathar/rust that referenced this pull request
…ss35
Make IoSlice and IoSliceMut methods unstably const
This enables constructing IoSlice and IoSliceMut in const contexts without users needing to break the platform abstraction by doing the cast themselves. This is useful for statics.
Since all current and plausible future platforms use simple slice-like structs, this should not impose a burden when adding a new platform with a different struct.
bors added a commit that referenced this pull request
Rollup of 3 pull requests
Successful merges:
- #144090 (Make
IoSliceandIoSliceMutmethods unstably const) - #145665 (Don't require
T: RefUnwindSafeforvec::IntoIter<T>: UnwindSafe) - #147818 (Unify and deduplicate max recip float tests)
r? @ghost
@rustbot modify labels: rollup
bors added S-waiting-on-author
Status: This is awaiting some action (such as code changes or more information) from the author.
and removed S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
labels