Skip to content

Commit bc3d719

Browse files
committed
review
1 parent 97c963d commit bc3d719

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

library/core/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@
137137
#![feature(const_size_of_val)]
138138
#![feature(const_slice_from_raw_parts_mut)]
139139
#![feature(const_slice_ptr_len)]
140-
#![feature(const_slice_split_at_not_mut)]
141140
#![feature(const_str_from_utf8_unchecked_mut)]
142141
#![feature(const_swap)]
143142
#![feature(const_trait_impl)]
@@ -150,6 +149,7 @@
150149
#![feature(maybe_uninit_uninit_array)]
151150
#![feature(ptr_metadata)]
152151
#![feature(slice_ptr_get)]
152+
#![feature(slice_split_at_unchecked)]
153153
#![feature(str_internals)]
154154
#![feature(utf16_extra)]
155155
#![feature(utf16_extra_const)]

library/core/src/slice/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1624,10 +1624,14 @@ impl<T> [T] {
16241624
/// }
16251625
/// ```
16261626
#[unstable(feature = "slice_split_at_unchecked", reason = "new API", issue = "76014")]
1627-
#[rustc_const_unstable(feature = "const_slice_split_at_not_mut", issue = "none")]
1627+
#[rustc_const_unstable(feature = "slice_split_at_unchecked", issue = "76014")]
16281628
#[inline]
16291629
#[must_use]
16301630
pub const unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T]) {
1631+
// HACK: the const function `from_raw_parts` is used to make this
1632+
// function const; previously the implementation used
1633+
// `(self.get_unchecked(..mid), self.get_unchecked(mid..))`
1634+
16311635
let len = self.len();
16321636
let ptr = self.as_ptr();
16331637

0 commit comments

Comments
 (0)