From 14769ce96f53553c9f61b9d5ef950cfbe85d7e51 Mon Sep 17 00:00:00 2001 From: ibraheemdev Date: Tue, 31 Aug 2021 13:25:09 -0400 Subject: [PATCH] enable `slice_swap_unchecked` feature in doc test --- library/core/src/slice/mod.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/core/src/slice/mod.rs b/library/core/src/slice/mod.rs index 2624df78a761..16e3c9e52fa9 100644 --- a/library/core/src/slice/mod.rs +++ b/library/core/src/slice/mod.rs @@ -583,6 +583,8 @@ impl [T] { /// # Examples /// /// ``` + /// #![feature(slice_swap_unchecked)] + /// /// let mut v = ["a", "b", "c", "d"]; /// // SAFETY: we know that 1 and 3 are both indices of the slice /// unsafe { v.swap_unchecked(1, 3) };