diff options
| author | Chris Denton <chris@chrisdenton.dev> | 2025-04-28 23:29:15 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-28 23:29:15 +0000 |
| commit | 17495e0030250202c28be85a35b366e37a32df3b (patch) | |
| tree | 6a30e4f1087a717c8a07cb9a3336e75cdf685e76 /src | |
| parent | d4845e1b0b745b4183096c363e3f4e71a45c14c9 (diff) | |
| parent | c49ddc0de3a7cc349774a8177d2baaf3902038da (diff) | |
Rollup merge of #139656 - scottmcm:stabilize-slice-as-chunks, r=dtolnay
Stabilize `slice_as_chunks` library feature
~~Draft as this needs #139163 to land first.~~
FCP: https://github.com/rust-lang/rust/issues/74985#issuecomment-2769963395
Methods being stabilized are:
```rust
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]];
}
```
~~(FCP's not done quite yet, but will in another day if I'm counting right.)~~ FCP Complete: https://github.com/rust-lang/rust/issues/74985#issuecomment-2797951535
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/miri/tests/pass/slices.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tools/miri/tests/pass/slices.rs b/src/tools/miri/tests/pass/slices.rs index dd18a061cdd..686683c3a25 100644 --- a/src/tools/miri/tests/pass/slices.rs +++ b/src/tools/miri/tests/pass/slices.rs @@ -1,7 +1,6 @@ //@revisions: stack tree //@[tree]compile-flags: -Zmiri-tree-borrows //@compile-flags: -Zmiri-strict-provenance -#![feature(slice_as_chunks)] #![feature(slice_partition_dedup)] #![feature(layout_for_ptr)] @@ -227,7 +226,7 @@ fn test_for_invalidated_pointers() { buffer.reverse(); - // Calls `fn as_chunks_unchecked_mut` internally (requires unstable `#![feature(slice_as_chunks)]`): + // Calls `fn as_chunks_unchecked_mut` internally: assert_eq!(2, buffer.as_chunks_mut::<32>().0.len()); for chunk in buffer.as_chunks_mut::<32>().0 { for elem in chunk { |
