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 }})

@thaliaarchi

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.

@rustbot

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 rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-libs

Relevant to the library team, which will review and decide on the PR/issue.

labels

Jul 17, 2025

@thaliaarchi

If this looks good, I'll open a tracking issue and link it.

@ibraheemdev

@rustbot rustbot added the T-libs-api

Relevant to the library API team, which will review and decide on the PR/issue.

label

Jul 17, 2025

@thaliaarchi

@BurntSushi Friendly ping. Would you mind taking a look at this?

@tgross35

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

@tgross35 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

Sep 3, 2025

@tgross35

For after discussion and updates,
r? libs

@thaliaarchi

@rustbot

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.

@Amanieu Amanieu removed T-libs

Relevant to the library team, which will review and decide on the PR/issue.

I-libs-api-nominated

Nominated for discussion during a libs-api team meeting.

labels

Sep 16, 2025

@Amanieu

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

@rust-rfcbot

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.

@thaliaarchi

@rustbot ready
(I neglected to remove the tag after resolving review feedback)

@rustbot rustbot removed the S-waiting-on-author

Status: This is awaiting some action (such as code changes or more information) from the author.

label

Oct 15, 2025

@rust-rfcbot

🔔 This is now entering its final comment period, as per the review above. 🔔

@rust-rfcbot

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.

tgross35

@tgross35

r? tgross35
@bors r+ rollup

@bors

📌 Commit 3cf5b88 has been approved by tgross35

It is now in the queue for this repository.

@bors 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

Oct 25, 2025

Zalathar added a commit to Zalathar/rust that referenced this pull request

Oct 26, 2025

@Zalathar

…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

Oct 26, 2025

@bors

Rollup of 3 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

@Zalathar

@bors 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

Oct 26, 2025

@bors

Labels