From 48dd2eb9daa7094ccd26f05a74148713d9680725 Mon Sep 17 00:00:00 2001 From: Waffle Date: Sun, 8 Aug 2021 20:41:24 +0300 Subject: [PATCH] Make `<[T]>::split_at_unchecked` and `<[T]>::split_at_mut_unchecked` public --- library/core/src/slice/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index de25c984abf90..6663a514426cc 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -1559,7 +1559,7 @@ impl [T] { /// /// # Examples /// - /// ```compile_fail + /// ``` /// #![feature(slice_split_at_unchecked)] /// /// let v = [1, 2, 3, 4, 5, 6]; @@ -1584,7 +1584,7 @@ impl [T] { /// ``` #[unstable(feature = "slice_split_at_unchecked", reason = "new API", issue = "76014")] #[inline] - unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T]) { + pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T]) { // SAFETY: Caller has to check that `0 <= mid <= self.len()` unsafe { (self.get_unchecked(..mid), self.get_unchecked(mid..)) } } @@ -1608,7 +1608,7 @@ impl [T] { /// /// # Examples /// - /// ```compile_fail + /// ``` /// #![feature(slice_split_at_unchecked)] /// /// let mut v = [1, 0, 3, 0, 5, 6]; @@ -1624,7 +1624,7 @@ impl [T] { /// ``` #[unstable(feature = "slice_split_at_unchecked", reason = "new API", issue = "76014")] #[inline] - unsafe fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut [T], &mut [T]) { + pub unsafe fn split_at_mut_unchecked(&mut self, mid: usize) -> (&mut [T], &mut [T]) { let len = self.len(); let ptr = self.as_mut_ptr();