Skip to content

Commit

Permalink
Auto merge of #108273 - tspiteri:const_slice_split_at_not_mut, r=dtolnay
Browse files Browse the repository at this point in the history
Stabilize const slice::split_at

This stabilizes the use of the following method in const context:

```rust
impl<T> [T] {
    pub const fn split_at(&self, mid: usize) -> (&[T], &[T]);
}
```

cc tracking issue #101158
  • Loading branch information
bors committed May 15, 2023
2 parents f5e6c67 + fbc5b30 commit bab811f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/src/slice/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1595,7 +1595,8 @@ impl<T> [T] {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature = "const_slice_split_at_not_mut", issue = "101158")]
#[rustc_const_stable(feature = "const_slice_split_at_not_mut", since = "CURRENT_RUSTC_VERSION")]
#[rustc_allow_const_fn_unstable(slice_split_at_unchecked)]
#[inline]
#[track_caller]
#[must_use]
Expand Down

0 comments on commit bab811f

Please sign in to comment.