Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Stabilizeslice_as_chunks library feature#139656

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
bors merged 2 commits intorust-lang:masterfromscottmcm:stabilize-slice-as-chunks
Apr 29, 2025

Conversation

@scottmcm
Copy link
Member

@scottmcmscottmcm commentedApr 11, 2025
edited
Loading

Draft as this needs#139163 to land first.

FCP:#74985 (comment)

Methods being stabilized are:

impl[T]{constfnas_chunks<constN:usize>(&self) ->(&[[T;N]],&[T]);constfnas_rchunks<constN:usize>(&self) ->(&[T],&[[T;N]]);constunsafefnas_chunks_unchecked<constN:usize>(&self) ->&[[T;N]];constfnas_chunks_mut<constN:usize>(&mutself) ->(&mut[[T;N]],&mut[T]);constfnas_rchunks_mut<constN:usize>(&mutself) ->(&mut[T],&mut[[T;N]]);constunsafefnas_chunks_unchecked_mut<constN:usize>(&mutself) ->&mut[[T;N]];}

(FCP's not done quite yet, but will in another day if I'm counting right.) FCP Complete:#74985 (comment)

MortenLohne, jasper310899, Aloso, n-gude, and Robbepop reacted with thumbs up emojifee1-dead, jdahlstrom, robertknight, scottlamb, sk1p, and robinhundt reacted with hooray emojijoseluis, edwloef, and tuguzT reacted with eyes emoji
@scottmcmscottmcm added the S-blockedStatus: Blocked on something else such as an RFC or other implementation work. labelApr 11, 2025
@rustbot
Copy link
Collaborator

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.

User? to explicitly pick a reviewer

@rustbotrustbot added S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. T-libsRelevant to the library team, which will review and decide on the PR/issue. labelsApr 11, 2025
@rust-log-analyzer

This comment has been minimized.

@scottmcmscottmcmforce-pushed thestabilize-slice-as-chunks branch from1f3dfae to6cfdd53CompareApril 11, 2025 04:17
@scottmcmscottmcm reopened thisApr 13, 2025
@scottmcmscottmcm marked this pull request as ready for reviewApril 13, 2025 07:30
@rustbot
Copy link
Collaborator

The Miri subtree was changed

cc @rust-lang/miri

@scottmcmscottmcm removed the S-blockedStatus: Blocked on something else such as an RFC or other implementation work. labelApr 13, 2025
@scottmcm
Copy link
MemberAuthor

@rust-lang/libs-api I wanted to drop you a ping because therehas been a reasonable amount of discussion during the FCP, so if you want me to hold off this for a bit to give you discussion time, let me know.

(I haven't seen any indication from comments that you've changed your minds, but it might just not have made it into the thread.)

@BurntSushi
Copy link
Member

Aye yeah, I'm still good with this. But given the discussion, holding for a second from another libs-api member seems prudent.

@dtolnay
Copy link
Member

LGTM as well. Thank you. We have talked about this feature across at least a half dozen library API team meetings and not diverged from favoring this design.

/// Panics if `N` is zero. This check will most probably get changed to a compile time
/// error before this method gets stabilized.
///
/// # Examples
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

In the section above (which I cannot comment because it is too far from the diff) we need to strike"This check will most probably get changed to a compile time error before this method gets stabilized."

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Oops, that had even been mentioned in#74985 (comment) and I forgot.

Did a pass over the docs to fix that bit, elaborate on the resulting lengths, and also add a cross-references between these methods andas_flattened(_mut).

@rustbot ready

@dtolnaydtolnay added S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelsApr 13, 2025
Also mention them from `as_flattened(_mut)`.
@rustbotrustbot added S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-authorStatus: This is awaiting some action (such as code changes or more information) from the author. labelsApr 19, 2025
@scottmcm
Copy link
MemberAuthor

Friendly ping here,@dtolnay

Copy link
Member

@dtolnaydtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thank you!

@dtolnay
Copy link
Member

@bors r+

@bors
Copy link
Collaborator

📌 Commitc49ddc0 has been approved bydtolnay

It is now in thequeue for this repository.

@borsbors removed the S-waiting-on-reviewStatus: Awaiting review from the assignee but also interested parties. labelApr 28, 2025
@borsbors added the S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion. labelApr 28, 2025
ChrisDenton added a commit to ChrisDenton/rust that referenced this pull requestApr 28, 2025
…, r=dtolnayStabilize `slice_as_chunks` library feature~~Draft as this needsrust-lang#139163 to land first.~~FCP:rust-lang#74985 (comment)Methods being stabilized are:```rustimpl [T] {    const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]);    const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]);    const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]];    const fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]);    const fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]);    const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]];}```~~(FCP's not done quite yet, but will in another day if I'm counting right.)~~ FCP Complete:rust-lang#74985 (comment)
bors added a commit to rust-lang-ci/rust that referenced this pull requestApr 28, 2025
…entonRollup of 10 pull requestsSuccessful merges: -rust-lang#139308 (add autodiff inline) -rust-lang#139656 (Stabilize `slice_as_chunks` library feature) -rust-lang#140022 (allow deref patterns to move out of boxes) -rust-lang#140276 (Do not compute type_of for impl item if impl where clauses are unsatisfied) -rust-lang#140302 (Move inline asm check to typeck, properly handle aliases) -rust-lang#140323 (Implement the internal feature `cfg_target_has_reliable_f16_f128`) -rust-lang#140391 (Rename sub_ptr to offset_from_unsigned in docs) -rust-lang#140394 (Make bootstrap git tests more self-contained) -rust-lang#140396 (Workaround for windows-gnu rust-lld test failure) -rust-lang#140402 (only return nested goals for `Certainty::Yes`)Failed merges: -rust-lang#139765 ([beta] Delay `hash_extract_if` stabilization from 1.87 to 1.88)r? `@ghost``@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull requestApr 29, 2025
…entonRollup of 10 pull requestsSuccessful merges: -rust-lang#139308 (add autodiff inline) -rust-lang#139656 (Stabilize `slice_as_chunks` library feature) -rust-lang#140022 (allow deref patterns to move out of boxes) -rust-lang#140276 (Do not compute type_of for impl item if impl where clauses are unsatisfied) -rust-lang#140302 (Move inline asm check to typeck, properly handle aliases) -rust-lang#140323 (Implement the internal feature `cfg_target_has_reliable_f16_f128`) -rust-lang#140391 (Rename sub_ptr to offset_from_unsigned in docs) -rust-lang#140394 (Make bootstrap git tests more self-contained) -rust-lang#140396 (Workaround for windows-gnu rust-lld test failure) -rust-lang#140402 (only return nested goals for `Certainty::Yes`)r? `@ghost``@rustbot` modify labels: rollup
@borsbors merged commit17495e0 intorust-lang:masterApr 29, 2025
6 checks passed
@rustbotrustbot added this to the1.88.0 milestoneApr 29, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull requestApr 29, 2025
Rollup merge ofrust-lang#139656 - scottmcm:stabilize-slice-as-chunks, r=dtolnayStabilize `slice_as_chunks` library feature~~Draft as this needsrust-lang#139163 to land first.~~FCP:rust-lang#74985 (comment)Methods being stabilized are:```rustimpl [T] {    const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]);    const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]);    const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]];    const fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]);    const fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]);    const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]];}```~~(FCP's not done quite yet, but will in another day if I'm counting right.)~~ FCP Complete:rust-lang#74985 (comment)
@scottmcmscottmcm deleted the stabilize-slice-as-chunks branchApril 29, 2025 06:14
github-actionsbot pushed a commit to model-checking/verify-rust-std that referenced this pull requestMay 9, 2025
…, r=dtolnayStabilize `slice_as_chunks` library feature~~Draft as this needsrust-lang#139163 to land first.~~FCP:rust-lang#74985 (comment)Methods being stabilized are:```rustimpl [T] {    const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]);    const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]);    const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]];    const fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]);    const fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]);    const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]];}```~~(FCP's not done quite yet, but will in another day if I'm counting right.)~~ FCP Complete:rust-lang#74985 (comment)
@jieyouxujieyouxu mentioned this pull requestJun 26, 2025
compiler-errors added a commit to compiler-errors/rust that referenced this pull requestJun 27, 2025
Fix 1.88 relnotes- Use stable std links for `impl Default for {*const,*mut} T`- Add missing relnotes forrust-lang#139656    ```rs    impl [T] {        const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]);        const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]);        const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]];        const fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]);        const fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]);        const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]];    }    ```- Add missing `mod ffi::c_str` and `hint::select_unpredictable`r? `@cuviper`
rust-timer added a commit that referenced this pull requestJun 27, 2025
Rollup merge of#143059 - jieyouxu:slice-as-chunks, r=cuviperFix 1.88 relnotes- Use stable std links for `impl Default for {*const,*mut} T`- Add missing relnotes for#139656    ```rs    impl [T] {        const fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T]);        const fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]]);        const unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]];        const fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T]);        const fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]]);        const unsafe fn as_chunks_unchecked_mut<const N: usize>(&mut self) -> &mut [[T; N]];    }    ```- Add missing `mod ffi::c_str` and `hint::select_unpredictable`r? `@cuviper`
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@dtolnaydtolnaydtolnay approved these changes

Assignees

@dtolnaydtolnay

Labels

S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-libsRelevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Milestone

1.88.0

Development

Successfully merging this pull request may close these issues.

7 participants

@scottmcm@rustbot@rust-log-analyzer@BurntSushi@dtolnay@bors@ibraheemdev

[8]ページ先頭

©2009-2025 Movatter.jp