diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2015-03-27 10:08:40 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2015-03-27 10:08:40 -0700 |
| commit | 956c2eb257a4ac69371144e64be3e8c7cce8cb07 (patch) | |
| tree | 10ff68950ad7982fdc0a77a82f979234fbd0f1a8 /src/libcore | |
| parent | 169231dc83b3078fd19d193ff422628f03e20a44 (diff) | |
| parent | 36ef29abf7fa14dc9361d6b30ff7f8d18bfb4157 (diff) | |
| download | rust-956c2eb257a4ac69371144e64be3e8c7cce8cb07.tar.gz rust-956c2eb257a4ac69371144e64be3e8c7cce8cb07.zip | |
rollup merge of #23738: alexcrichton/snapshots
Conflicts: src/libcollections/vec.rs
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/intrinsics.rs | 23 | ||||
| -rw-r--r-- | src/libcore/ops.rs | 62 | ||||
| -rw-r--r-- | src/libcore/slice.rs | 185 | ||||
| -rw-r--r-- | src/libcore/str/mod.rs | 88 |
4 files changed, 0 insertions, 358 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs index eb74a41db55..342671096e2 100644 --- a/src/libcore/intrinsics.rs +++ b/src/libcore/intrinsics.rs @@ -44,10 +44,6 @@ use marker::Sized; -#[cfg(stage0)] pub use self::copy_memory as copy; -#[cfg(stage0)] pub use self::set_memory as write_bytes; -#[cfg(stage0)] pub use self::copy_nonoverlapping_memory as copy_nonoverlapping; - extern "rust-intrinsic" { // NB: These intrinsics take unsafe pointers because they mutate aliased @@ -183,7 +179,6 @@ extern "rust-intrinsic" { pub fn pref_align_of<T>() -> usize; /// Gets a static string slice containing the name of a type. - #[cfg(not(stage0))] pub fn type_name<T: ?Sized>() -> &'static str; /// Gets an identifier which is globally unique to the specified type. This @@ -309,14 +304,8 @@ extern "rust-intrinsic" { /// } /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[cfg(not(stage0))] pub fn copy_nonoverlapping<T>(dst: *mut T, src: *const T, count: usize); - /// dox - #[stable(feature = "rust1", since = "1.0.0")] - #[cfg(stage0)] - pub fn copy_nonoverlapping_memory<T>(dst: *mut T, src: *const T, count: usize); - /// Copies `count * size_of<T>` bytes from `src` to `dst`. The source /// and destination may overlap. /// @@ -345,26 +334,14 @@ extern "rust-intrinsic" { /// } /// ``` /// - #[cfg(not(stage0))] #[stable(feature = "rust1", since = "1.0.0")] pub fn copy<T>(dst: *mut T, src: *const T, count: usize); - /// dox - #[cfg(stage0)] - #[stable(feature = "rust1", since = "1.0.0")] - pub fn copy_memory<T>(dst: *mut T, src: *const T, count: usize); - /// Invokes memset on the specified pointer, setting `count * size_of::<T>()` /// bytes of memory starting at `dst` to `c`. - #[cfg(not(stage0))] #[stable(feature = "rust1", since = "1.0.0")] pub fn write_bytes<T>(dst: *mut T, val: u8, count: usize); - /// dox - #[cfg(stage0)] - #[stable(feature = "rust1", since = "1.0.0")] - pub fn set_memory<T>(dst: *mut T, val: u8, count: usize); - /// Equivalent to the appropriate `llvm.memcpy.p0i8.0i8.*` intrinsic, with /// a size of `count` * `size_of::<T>()` and an alignment of /// `min_align_of::<T>()` diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 16d03901239..26deb80d8c5 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -917,12 +917,6 @@ pub trait Index<Idx: ?Sized> { type Output: ?Sized; /// The method for the indexing (`Foo[Bar]`) operation - #[cfg(stage0)] - #[stable(feature = "rust1", since = "1.0.0")] - fn index<'a>(&'a self, index: &Idx) -> &'a Self::Output; - - /// The method for the indexing (`Foo[Bar]`) operation - #[cfg(not(stage0))] #[stable(feature = "rust1", since = "1.0.0")] fn index<'a>(&'a self, index: Idx) -> &'a Self::Output; } @@ -966,12 +960,6 @@ pub trait Index<Idx: ?Sized> { #[stable(feature = "rust1", since = "1.0.0")] pub trait IndexMut<Idx: ?Sized>: Index<Idx> { /// The method for the indexing (`Foo[Bar]`) operation - #[cfg(stage0)] - #[stable(feature = "rust1", since = "1.0.0")] - fn index_mut<'a>(&'a mut self, index: &Idx) -> &'a mut Self::Output; - - /// The method for the indexing (`Foo[Bar]`) operation - #[cfg(not(stage0))] #[stable(feature = "rust1", since = "1.0.0")] fn index_mut<'a>(&'a mut self, index: Idx) -> &'a mut Self::Output; } @@ -1149,20 +1137,6 @@ impl<'a, T: ?Sized> DerefMut for &'a mut T { #[lang="fn"] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] -#[cfg(stage0)] -pub trait Fn<Args> { - /// The returned type after the call operator is used. - type Output; - - /// This is called when the call operator is used. - extern "rust-call" fn call(&self, args: Args) -> Self::Output; -} - -/// A version of the call operator that takes an immutable receiver. -#[lang="fn"] -#[stable(feature = "rust1", since = "1.0.0")] -#[rustc_paren_sugar] -#[cfg(not(stage0))] pub trait Fn<Args> : FnMut<Args> { /// This is called when the call operator is used. extern "rust-call" fn call(&self, args: Args) -> Self::Output; @@ -1172,20 +1146,6 @@ pub trait Fn<Args> : FnMut<Args> { #[lang="fn_mut"] #[stable(feature = "rust1", since = "1.0.0")] #[rustc_paren_sugar] -#[cfg(stage0)] -pub trait FnMut<Args> { - /// The returned type after the call operator is used. - type Output; - - /// This is called when the call operator is used. - extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; -} - -/// A version of the call operator that takes a mutable receiver. -#[lang="fn_mut"] -#[stable(feature = "rust1", since = "1.0.0")] -#[rustc_paren_sugar] -#[cfg(not(stage0))] pub trait FnMut<Args> : FnOnce<Args> { /// This is called when the call operator is used. extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; @@ -1202,25 +1162,3 @@ pub trait FnOnce<Args> { /// This is called when the call operator is used. extern "rust-call" fn call_once(self, args: Args) -> Self::Output; } - -#[cfg(stage0)] -impl<F: ?Sized, A> FnMut<A> for F - where F : Fn<A> -{ - type Output = <F as Fn<A>>::Output; - - extern "rust-call" fn call_mut(&mut self, args: A) -> <F as Fn<A>>::Output { - self.call(args) - } -} - -#[cfg(stage0)] -impl<F,A> FnOnce<A> for F - where F : FnMut<A> -{ - type Output = <F as FnMut<A>>::Output; - - extern "rust-call" fn call_once(mut self, args: A) -> <F as FnMut<A>>::Output { - self.call_mut(args) - } -} diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 892660b98bc..12cfdbf5306 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -269,18 +269,6 @@ impl<T> SliceExt for [T] { #[deprecated(since = "1.0.0", reason = "use &mut s[..] instead")] fn as_mut_slice(&mut self) -> &mut [T] { self } - #[cfg(stage0)] - #[inline] - fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) { - unsafe { - let self2: &mut [T] = mem::transmute_copy(&self); - - (ops::IndexMut::index_mut(self, &ops::RangeTo { end: mid } ), - ops::IndexMut::index_mut(self2, &ops::RangeFrom { start: mid } )) - } - } - - #[cfg(not(stage0))] #[inline] fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) { unsafe { @@ -513,14 +501,6 @@ impl<T> SliceExt for [T] { impl<T> ops::Index<usize> for [T] { type Output = T; - #[cfg(stage0)] - fn index(&self, &index: &usize) -> &T { - assert!(index < self.len()); - - unsafe { mem::transmute(self.repr().data.offset(index as isize)) } - } - - #[cfg(not(stage0))] fn index(&self, index: usize) -> &T { assert!(index < self.len()); @@ -530,15 +510,6 @@ impl<T> ops::Index<usize> for [T] { #[stable(feature = "rust1", since = "1.0.0")] impl<T> ops::IndexMut<usize> for [T] { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, &index: &usize) -> &mut T { - assert!(index < self.len()); - - unsafe { mem::transmute(self.repr().data.offset(index as isize)) } - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, index: usize) -> &mut T { assert!(index < self.len()); @@ -551,20 +522,6 @@ impl<T> ops::IndexMut<usize> for [T] { impl<T> ops::Index<ops::Range<usize>> for [T] { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::Range<usize>) -> &[T] { - assert!(index.start <= index.end); - assert!(index.end <= self.len()); - unsafe { - from_raw_parts ( - self.as_ptr().offset(index.start as isize), - index.end - index.start - ) - } - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::Range<usize>) -> &[T] { assert!(index.start <= index.end); @@ -581,13 +538,6 @@ impl<T> ops::Index<ops::Range<usize>> for [T] { impl<T> ops::Index<ops::RangeTo<usize>> for [T] { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeTo<usize>) -> &[T] { - self.index(&ops::Range{ start: 0, end: index.end }) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeTo<usize>) -> &[T] { self.index(ops::Range{ start: 0, end: index.end }) @@ -597,13 +547,6 @@ impl<T> ops::Index<ops::RangeTo<usize>> for [T] { impl<T> ops::Index<ops::RangeFrom<usize>> for [T] { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] { - self.index(&ops::Range{ start: index.start, end: self.len() }) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeFrom<usize>) -> &[T] { self.index(ops::Range{ start: index.start, end: self.len() }) @@ -613,13 +556,6 @@ impl<T> ops::Index<ops::RangeFrom<usize>> for [T] { impl<T> ops::Index<RangeFull> for [T] { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, _index: &RangeFull) -> &[T] { - self - } - - #[cfg(not(stage0))] #[inline] fn index(&self, _index: RangeFull) -> &[T] { self @@ -628,20 +564,6 @@ impl<T> ops::Index<RangeFull> for [T] { #[stable(feature = "rust1", since = "1.0.0")] impl<T> ops::IndexMut<ops::Range<usize>> for [T] { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, index: &ops::Range<usize>) -> &mut [T] { - assert!(index.start <= index.end); - assert!(index.end <= self.len()); - unsafe { - from_raw_parts_mut( - self.as_mut_ptr().offset(index.start as isize), - index.end - index.start - ) - } - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, index: ops::Range<usize>) -> &mut [T] { assert!(index.start <= index.end); @@ -656,13 +578,6 @@ impl<T> ops::IndexMut<ops::Range<usize>> for [T] { } #[stable(feature = "rust1", since = "1.0.0")] impl<T> ops::IndexMut<ops::RangeTo<usize>> for [T] { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, index: &ops::RangeTo<usize>) -> &mut [T] { - self.index_mut(&ops::Range{ start: 0, end: index.end }) - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut [T] { self.index_mut(ops::Range{ start: 0, end: index.end }) @@ -670,14 +585,6 @@ impl<T> ops::IndexMut<ops::RangeTo<usize>> for [T] { } #[stable(feature = "rust1", since = "1.0.0")] impl<T> ops::IndexMut<ops::RangeFrom<usize>> for [T] { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, index: &ops::RangeFrom<usize>) -> &mut [T] { - let len = self.len(); - self.index_mut(&ops::Range{ start: index.start, end: len }) - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut [T] { let len = self.len(); @@ -686,14 +593,6 @@ impl<T> ops::IndexMut<ops::RangeFrom<usize>> for [T] { } #[stable(feature = "rust1", since = "1.0.0")] impl<T> ops::IndexMut<RangeFull> for [T] { - - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] { - self - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, _index: RangeFull) -> &mut [T] { self @@ -881,13 +780,6 @@ unsafe impl<'a, T: Sync> Send for Iter<'a, T> {} impl<'a, T> ops::Index<ops::Range<usize>> for Iter<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::Range<usize>) -> &[T] { - self.as_slice().index(index) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::Range<usize>) -> &[T] { self.as_slice().index(index) @@ -898,13 +790,6 @@ impl<'a, T> ops::Index<ops::Range<usize>> for Iter<'a, T> { impl<'a, T> ops::Index<ops::RangeTo<usize>> for Iter<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeTo<usize>) -> &[T] { - self.as_slice().index(index) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeTo<usize>) -> &[T] { self.as_slice().index(index) @@ -915,13 +800,6 @@ impl<'a, T> ops::Index<ops::RangeTo<usize>> for Iter<'a, T> { impl<'a, T> ops::Index<ops::RangeFrom<usize>> for Iter<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] { - self.as_slice().index(index) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeFrom<usize>) -> &[T] { self.as_slice().index(index) @@ -932,13 +810,6 @@ impl<'a, T> ops::Index<ops::RangeFrom<usize>> for Iter<'a, T> { impl<'a, T> ops::Index<RangeFull> for Iter<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, _index: &RangeFull) -> &[T] { - self.as_slice() - } - - #[cfg(not(stage0))] #[inline] fn index(&self, _index: RangeFull) -> &[T] { self.as_slice() @@ -1006,13 +877,6 @@ unsafe impl<'a, T: Send> Send for IterMut<'a, T> {} impl<'a, T> ops::Index<ops::Range<usize>> for IterMut<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::Range<usize>) -> &[T] { - self.index(&RangeFull).index(index) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::Range<usize>) -> &[T] { self.index(RangeFull).index(index) @@ -1022,13 +886,6 @@ impl<'a, T> ops::Index<ops::Range<usize>> for IterMut<'a, T> { impl<'a, T> ops::Index<ops::RangeTo<usize>> for IterMut<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeTo<usize>) -> &[T] { - self.index(&RangeFull).index(index) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeTo<usize>) -> &[T] { self.index(RangeFull).index(index) @@ -1038,13 +895,6 @@ impl<'a, T> ops::Index<ops::RangeTo<usize>> for IterMut<'a, T> { impl<'a, T> ops::Index<ops::RangeFrom<usize>> for IterMut<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeFrom<usize>) -> &[T] { - self.index(&RangeFull).index(index) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeFrom<usize>) -> &[T] { self.index(RangeFull).index(index) @@ -1054,13 +904,6 @@ impl<'a, T> ops::Index<ops::RangeFrom<usize>> for IterMut<'a, T> { impl<'a, T> ops::Index<RangeFull> for IterMut<'a, T> { type Output = [T]; - #[cfg(stage0)] - #[inline] - fn index(&self, _index: &RangeFull) -> &[T] { - make_slice!(T => &[T]: self.ptr, self.end) - } - - #[cfg(not(stage0))] #[inline] fn index(&self, _index: RangeFull) -> &[T] { make_slice!(T => &[T]: self.ptr, self.end) @@ -1069,13 +912,6 @@ impl<'a, T> ops::Index<RangeFull> for IterMut<'a, T> { #[unstable(feature = "core")] impl<'a, T> ops::IndexMut<ops::Range<usize>> for IterMut<'a, T> { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, index: &ops::Range<usize>) -> &mut [T] { - self.index_mut(&RangeFull).index_mut(index) - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, index: ops::Range<usize>) -> &mut [T] { self.index_mut(RangeFull).index_mut(index) @@ -1084,13 +920,6 @@ impl<'a, T> ops::IndexMut<ops::Range<usize>> for IterMut<'a, T> { #[unstable(feature = "core")] impl<'a, T> ops::IndexMut<ops::RangeTo<usize>> for IterMut<'a, T> { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, index: &ops::RangeTo<usize>) -> &mut [T] { - self.index_mut(&RangeFull).index_mut(index) - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, index: ops::RangeTo<usize>) -> &mut [T] { self.index_mut(RangeFull).index_mut(index) @@ -1099,13 +928,6 @@ impl<'a, T> ops::IndexMut<ops::RangeTo<usize>> for IterMut<'a, T> { #[unstable(feature = "core")] impl<'a, T> ops::IndexMut<ops::RangeFrom<usize>> for IterMut<'a, T> { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, index: &ops::RangeFrom<usize>) -> &mut [T] { - self.index_mut(&RangeFull).index_mut(index) - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, index: ops::RangeFrom<usize>) -> &mut [T] { self.index_mut(RangeFull).index_mut(index) @@ -1114,13 +936,6 @@ impl<'a, T> ops::IndexMut<ops::RangeFrom<usize>> for IterMut<'a, T> { #[unstable(feature = "core")] impl<'a, T> ops::IndexMut<RangeFull> for IterMut<'a, T> { - #[cfg(stage0)] - #[inline] - fn index_mut(&mut self, _index: &RangeFull) -> &mut [T] { - make_mut_slice!(T => &mut [T]: self.ptr, self.end) - } - - #[cfg(not(stage0))] #[inline] fn index_mut(&mut self, _index: RangeFull) -> &mut [T] { make_mut_slice!(T => &mut [T]: self.ptr, self.end) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index a629e0308e9..7fe3758ed95 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -541,17 +541,6 @@ delegate_iter!{exact u8 : Bytes<'a>} #[derive(Copy, Clone)] struct BytesDeref; -#[cfg(stage0)] -impl<'a> Fn<(&'a u8,)> for BytesDeref { - type Output = u8; - - #[inline] - extern "rust-call" fn call(&self, (ptr,): (&'a u8,)) -> u8 { - *ptr - } -} - -#[cfg(not(stage0))] impl<'a> Fn<(&'a u8,)> for BytesDeref { #[inline] extern "rust-call" fn call(&self, (ptr,): (&'a u8,)) -> u8 { @@ -559,7 +548,6 @@ impl<'a> Fn<(&'a u8,)> for BytesDeref { } } -#[cfg(not(stage0))] impl<'a> FnMut<(&'a u8,)> for BytesDeref { #[inline] extern "rust-call" fn call_mut(&mut self, (ptr,): (&'a u8,)) -> u8 { @@ -567,7 +555,6 @@ impl<'a> FnMut<(&'a u8,)> for BytesDeref { } } -#[cfg(not(stage0))] impl<'a> FnOnce<(&'a u8,)> for BytesDeref { type Output = u8; @@ -1319,50 +1306,6 @@ mod traits { /// // byte 100 is outside the string /// // &s[3 .. 100]; /// ``` - #[cfg(stage0)] - #[stable(feature = "rust1", since = "1.0.0")] - impl ops::Index<ops::Range<usize>> for str { - type Output = str; - #[inline] - fn index(&self, index: &ops::Range<usize>) -> &str { - // is_char_boundary checks that the index is in [0, .len()] - if index.start <= index.end && - self.is_char_boundary(index.start) && - self.is_char_boundary(index.end) { - unsafe { self.slice_unchecked(index.start, index.end) } - } else { - super::slice_error_fail(self, index.start, index.end) - } - } - } - - /// Returns a slice of the given string from the byte range - /// [`begin`..`end`). - /// - /// This operation is `O(1)`. - /// - /// Panics when `begin` and `end` do not point to valid characters - /// or point beyond the last character of the string. - /// - /// # Examples - /// - /// ``` - /// let s = "Löwe 老虎 Léopard"; - /// assert_eq!(&s[0 .. 1], "L"); - /// - /// assert_eq!(&s[1 .. 9], "öwe 老"); - /// - /// // these will panic: - /// // byte 2 lies within `ö`: - /// // &s[2 ..3]; - /// - /// // byte 8 lies within `老` - /// // &s[1 .. 8]; - /// - /// // byte 100 is outside the string - /// // &s[3 .. 100]; - /// ``` - #[cfg(not(stage0))] #[stable(feature = "rust1", since = "1.0.0")] impl ops::Index<ops::Range<usize>> for str { type Output = str; @@ -1390,18 +1333,6 @@ mod traits { impl ops::Index<ops::RangeTo<usize>> for str { type Output = str; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeTo<usize>) -> &str { - // is_char_boundary checks that the index is in [0, .len()] - if self.is_char_boundary(index.end) { - unsafe { self.slice_unchecked(0, index.end) } - } else { - super::slice_error_fail(self, 0, index.end) - } - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeTo<usize>) -> &str { // is_char_boundary checks that the index is in [0, .len()] @@ -1423,18 +1354,6 @@ mod traits { impl ops::Index<ops::RangeFrom<usize>> for str { type Output = str; - #[cfg(stage0)] - #[inline] - fn index(&self, index: &ops::RangeFrom<usize>) -> &str { - // is_char_boundary checks that the index is in [0, .len()] - if self.is_char_boundary(index.start) { - unsafe { self.slice_unchecked(index.start, self.len()) } - } else { - super::slice_error_fail(self, index.start, self.len()) - } - } - - #[cfg(not(stage0))] #[inline] fn index(&self, index: ops::RangeFrom<usize>) -> &str { // is_char_boundary checks that the index is in [0, .len()] @@ -1450,13 +1369,6 @@ mod traits { impl ops::Index<ops::RangeFull> for str { type Output = str; - #[cfg(stage0)] - #[inline] - fn index(&self, _index: &ops::RangeFull) -> &str { - self - } - - #[cfg(not(stage0))] #[inline] fn index(&self, _index: ops::RangeFull) -> &str { self |
