enable slice_swap_unchecked feature in doc test
This commit is contained in:
parent
1afe14ceed
commit
14769ce96f
1 changed files with 2 additions and 0 deletions
|
|
@ -583,6 +583,8 @@ impl<T> [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) };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue