/// Copying four bytes within a slice:
///
/// ```
- /// # #![feature(copy_within)]
/// let mut bytes = *b"Hello, World!";
///
/// bytes.copy_within(1..5, 8);
///
/// assert_eq!(&bytes, b"Hello, Wello!");
/// ```
- #[unstable(feature = "copy_within", issue = "54236")]
+ #[stable(feature = "copy_within", since = "1.37.0")]
pub fn copy_within<R: ops::RangeBounds<usize>>(&mut self, src: R, dest: usize)
where
T: Copy,
assert!(dest <= self.len() - count, "dest is out of bounds");
unsafe {
ptr::copy(
- self.get_unchecked(src_start),
- self.get_unchecked_mut(dest),
+ self.as_ptr().add(src_start),
+ self.as_mut_ptr().add(dest),
count,
);
}
}
impl_marker_for!(BytewiseEquality,
- u8 i8 u16 i16 u32 i32 u64 i64 usize isize char bool);
+ u8 i8 u16 i16 u32 i32 u64 i64 u128 i128 usize isize char bool);
#[doc(hidden)]
unsafe impl<'a, T> TrustedRandomAccess for Iter<'a, T> {
+#![feature(bound_cloned)]
#![feature(box_syntax)]
#![feature(cell_update)]
#![feature(core_private_bignum)]
#![feature(fmt_internals)]
#![feature(hashmap_internals)]
#![feature(is_sorted)]
-#![feature(iter_nth_back)]
#![feature(iter_once_with)]
#![feature(pattern)]
#![feature(range_is_empty)]
#![feature(test)]
#![feature(trusted_len)]
#![feature(try_trait)]
-#![feature(reverse_bits)]
#![feature(inner_deref)]
#![feature(slice_internals)]
#![feature(slice_partition_dedup)]
- #![feature(copy_within)]
#![feature(int_error_matching)]
#![feature(const_fn)]
#![warn(rust_2018_idioms)]