about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-24 18:13:54 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-26 09:57:05 -0700
commit36ef29abf7fa14dc9361d6b30ff7f8d18bfb4157 (patch)
tree7769ba1cae0d202a55b219efb2a04032f3bf70eb /src/libcore
parent557d4346a26266d2eb13f6b0adf106b8873b0da1 (diff)
downloadrust-36ef29abf7fa14dc9361d6b30ff7f8d18bfb4157.tar.gz
rust-36ef29abf7fa14dc9361d6b30ff7f8d18bfb4157.zip
Register new snapshots
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/intrinsics.rs23
-rw-r--r--src/libcore/ops.rs62
-rw-r--r--src/libcore/slice.rs185
-rw-r--r--src/libcore/str/mod.rs88
4 files changed, 0 insertions, 358 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 1f1044b0b21..211b0152c33 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
@@ -287,14 +282,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.
     ///
@@ -323,26 +312,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 fce29abed73..d5e8b4ce81e 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -263,18 +263,6 @@ impl<T> SliceExt for [T] {
     #[inline]
     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 {
@@ -507,14 +495,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());
 
@@ -524,15 +504,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());
@@ -545,20 +516,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);
@@ -575,13 +532,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 })
@@ -591,13 +541,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() })
@@ -607,13 +550,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
@@ -622,20 +558,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);
@@ -650,13 +572,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 })
@@ -664,14 +579,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();
@@ -680,14 +587,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
@@ -875,13 +774,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)
@@ -892,13 +784,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)
@@ -909,13 +794,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)
@@ -926,13 +804,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()
@@ -1000,13 +871,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)
@@ -1016,13 +880,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)
@@ -1032,13 +889,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)
@@ -1048,13 +898,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)
@@ -1063,13 +906,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)
@@ -1078,13 +914,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)
@@ -1093,13 +922,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)
@@ -1108,13 +930,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