about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-10-10 21:59:10 -0700
committerAlex Crichton <alex@alexcrichton.com>2014-10-10 22:09:49 -0700
commitdae48a07f34dcf714b3b57029f4e03a0b95a269e (patch)
tree4ced3fe4c6c167508f0f7d1308473dfec676846d /src/libcore
parent1add4dedc131d5f98d82feafe80d92ed1f3f6d49 (diff)
downloadrust-dae48a07f34dcf714b3b57029f4e03a0b95a269e.tar.gz
rust-dae48a07f34dcf714b3b57029f4e03a0b95a269e.zip
Register new snapshots
Also convert a number of `static mut` to just a plain old `static` and remove
some unsafe blocks.
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/intrinsics.rs1
-rw-r--r--src/libcore/ops.rs33
-rw-r--r--src/libcore/slice.rs59
-rw-r--r--src/libcore/str.rs23
4 files changed, 1 insertions, 115 deletions
diff --git a/src/libcore/intrinsics.rs b/src/libcore/intrinsics.rs
index 7d86b65168f..3f7dcb36cf6 100644
--- a/src/libcore/intrinsics.rs
+++ b/src/libcore/intrinsics.rs
@@ -254,7 +254,6 @@ extern "rust-intrinsic" {
     /// enabling further optimizations.
     ///
     /// NB: This is very different from the `unreachable!()` macro!
-    #[cfg(not(stage0))]
     pub fn unreachable() -> !;
 
     /// Execute a breakpoint trap, for inspection by a debugger.
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index b08432c773e..f7cfa4c1baf 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -711,7 +711,6 @@ pub trait IndexMut<Index, Result> {
  * }
  * ```
  */
-#[cfg(not(stage0))]
 #[lang="slice"]
 pub trait Slice<Idx, Sized? Result> for Sized? {
     /// The method for the slicing operation foo[]
@@ -723,21 +722,6 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
     /// The method for the slicing operation foo[from..to]
     fn slice_or_fail<'a>(&'a self, from: &Idx, to: &Idx) -> &'a Result;
 }
-#[cfg(stage0)]
-/**
- *
- */
-#[lang="slice"]
-pub trait Slice<Idx, Sized? Result> for Sized? {
-    /// The method for the slicing operation foo[]
-    fn as_slice_<'a>(&'a self) -> &'a Result;
-    /// The method for the slicing operation foo[from..]
-    fn slice_from_<'a>(&'a self, from: &Idx) -> &'a Result;
-    /// The method for the slicing operation foo[..to]
-    fn slice_to_<'a>(&'a self, to: &Idx) -> &'a Result;
-    /// The method for the slicing operation foo[from..to]
-    fn slice_<'a>(&'a self, from: &Idx, to: &Idx) -> &'a Result;
-}
 
 /**
  *
@@ -776,7 +760,6 @@ pub trait Slice<Idx, Sized? Result> for Sized? {
  * }
  * ```
  */
-#[cfg(not(stage0))]
 #[lang="slice_mut"]
 pub trait SliceMut<Idx, Sized? Result> for Sized? {
     /// The method for the slicing operation foo[]
@@ -788,21 +771,7 @@ pub trait SliceMut<Idx, Sized? Result> for Sized? {
     /// The method for the slicing operation foo[from..to]
     fn slice_or_fail_mut<'a>(&'a mut self, from: &Idx, to: &Idx) -> &'a mut Result;
 }
-#[cfg(stage0)]
-/**
- *
- */
-#[lang="slice_mut"]
-pub trait SliceMut<Idx, Sized? Result> for Sized? {
-    /// The method for the slicing operation foo[mut]
-    fn as_mut_slice_<'a>(&'a mut self) -> &'a mut Result;
-    /// The method for the slicing operation foo[mut from..]
-    fn slice_from_mut_<'a>(&'a mut self, from: &Idx) -> &'a mut Result;
-    /// The method for the slicing operation foo[mut ..to]
-    fn slice_to_mut_<'a>(&'a mut self, to: &Idx) -> &'a mut Result;
-    /// The method for the slicing operation foo[mut from..to]
-    fn slice_mut_<'a>(&'a mut self, from: &Idx, to: &Idx) -> &'a mut Result;
-}
+
 /**
  *
  * The `Deref` trait is used to specify the functionality of dereferencing
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index 02c0c9bf310..5847a6177d7 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -488,7 +488,6 @@ impl<'a,T> ImmutableSlice<'a, T> for &'a [T] {
 
 
 
-#[cfg(not(stage0))]
 impl<T> ops::Slice<uint, [T]> for [T] {
     #[inline]
     fn as_slice_<'a>(&'a self) -> &'a [T] {
@@ -516,36 +515,7 @@ impl<T> ops::Slice<uint, [T]> for [T] {
         }
     }
 }
-#[cfg(stage0)]
-impl<T> ops::Slice<uint, [T]> for [T] {
-    #[inline]
-    fn as_slice_<'a>(&'a self) -> &'a [T] {
-        self
-    }
-
-    #[inline]
-    fn slice_from_<'a>(&'a self, start: &uint) -> &'a [T] {
-        self.slice_(start, &self.len())
-    }
 
-    #[inline]
-    fn slice_to_<'a>(&'a self, end: &uint) -> &'a [T] {
-        self.slice_(&0, end)
-    }
-    #[inline]
-    fn slice_<'a>(&'a self, start: &uint, end: &uint) -> &'a [T] {
-        assert!(*start <= *end);
-        assert!(*end <= self.len());
-        unsafe {
-            transmute(RawSlice {
-                    data: self.as_ptr().offset(*start as int),
-                    len: (*end - *start)
-                })
-        }
-    }
-}
-
-#[cfg(not(stage0))]
 impl<T> ops::SliceMut<uint, [T]> for [T] {
     #[inline]
     fn as_mut_slice_<'a>(&'a mut self) -> &'a mut [T] {
@@ -574,35 +544,6 @@ impl<T> ops::SliceMut<uint, [T]> for [T] {
         }
     }
 }
-#[cfg(stage0)]
-impl<T> ops::SliceMut<uint, [T]> for [T] {
-    #[inline]
-    fn as_mut_slice_<'a>(&'a mut self) -> &'a mut [T] {
-        self
-    }
-
-    #[inline]
-    fn slice_from_mut_<'a>(&'a mut self, start: &uint) -> &'a mut [T] {
-        let len = &self.len();
-        self.slice_mut_(start, len)
-    }
-
-    #[inline]
-    fn slice_to_mut_<'a>(&'a mut self, end: &uint) -> &'a mut [T] {
-        self.slice_mut_(&0, end)
-    }
-    #[inline]
-    fn slice_mut_<'a>(&'a mut self, start: &uint, end: &uint) -> &'a mut [T] {
-        assert!(*start <= *end);
-        assert!(*end <= self.len());
-        unsafe {
-            transmute(RawSlice {
-                    data: self.as_ptr().offset(*start as int),
-                    len: (*end - *start)
-                })
-        }
-    }
-}
 
 /// Extension methods for slices such that their elements are
 /// mutable.
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 1cbe955274b..e8cd93ba7dc 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -1164,29 +1164,6 @@ pub mod traits {
         fn equiv(&self, other: &S) -> bool { eq_slice(*self, other.as_slice()) }
     }
 
-    #[cfg(stage0)]
-    impl ops::Slice<uint, str> for str {
-        #[inline]
-        fn as_slice_<'a>(&'a self) -> &'a str {
-            self
-        }
-
-        #[inline]
-        fn slice_from_<'a>(&'a self, from: &uint) -> &'a str {
-            self.slice_from(*from)
-        }
-
-        #[inline]
-        fn slice_to_<'a>(&'a self, to: &uint) -> &'a str {
-            self.slice_to(*to)
-        }
-
-        #[inline]
-        fn slice_<'a>(&'a self, from: &uint, to: &uint) -> &'a str {
-            self.slice(*from, *to)
-        }
-    }
-    #[cfg(not(stage0))]
     impl ops::Slice<uint, str> for str {
         #[inline]
         fn as_slice_<'a>(&'a self) -> &'a str {