From: Mazdak Farrokhzad Date: Wed, 12 Jun 2019 23:49:26 +0000 (+0200) Subject: Rollup merge of #61398 - kennytm:stabilize-copy-within, r=SimonSapin X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=a1ff450a68e115e884f3ced8ba17fe5971202da4;hp=-c;p=rust.git Rollup merge of #61398 - kennytm:stabilize-copy-within, r=SimonSapin Stabilize copy_within Closes #54236. --- a1ff450a68e115e884f3ced8ba17fe5971202da4 diff --combined src/libcore/slice/mod.rs index c9c73f4d66e,231082e5a17..d93e5a9ca2b --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@@ -2146,14 -2146,13 +2146,13 @@@ impl [T] /// 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>(&mut self, src: R, dest: usize) where T: Copy, @@@ -2178,8 -2177,8 +2177,8 @@@ 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, ); } @@@ -5420,7 -5419,7 +5419,7 @@@ macro_rules! impl_marker_for } 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> { diff --combined src/libcore/tests/lib.rs index 928bdd7a760,d789c22053a..bf072a9243b --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@@ -1,4 -1,3 +1,4 @@@ +#![feature(bound_cloned)] #![feature(box_syntax)] #![feature(cell_update)] #![feature(core_private_bignum)] @@@ -11,6 -10,7 +11,6 @@@ #![feature(fmt_internals)] #![feature(hashmap_internals)] #![feature(is_sorted)] -#![feature(iter_nth_back)] #![feature(iter_once_with)] #![feature(pattern)] #![feature(range_is_empty)] @@@ -25,10 -25,10 +25,9 @@@ #![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)]