about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2014-11-12 12:17:55 -0800
committerAlex Crichton <alex@alexcrichton.com>2014-11-12 12:17:55 -0800
commit065e39bb2fd439d792d8a8f72a7182dfc8b7c5a3 (patch)
tree7dc0761aee6f0eef769a3a4bbc475d3df7a789f4 /src/libcore
parente4ead7b034c96b705ec34b8325f5f9f778f1cbb9 (diff)
downloadrust-065e39bb2fd439d792d8a8f72a7182dfc8b7c5a3.tar.gz
rust-065e39bb2fd439d792d8a8f72a7182dfc8b7c5a3.zip
Register new snapshots
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/cmp.rs219
-rw-r--r--src/libcore/lib.rs1
-rw-r--r--src/libcore/ops.rs3
-rw-r--r--src/libcore/slice.rs77
-rw-r--r--src/libcore/str.rs45
5 files changed, 0 insertions, 345 deletions
diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs
index 6e87fe4ced0..078cfce128e 100644
--- a/src/libcore/cmp.rs
+++ b/src/libcore/cmp.rs
@@ -55,33 +55,6 @@ use option::{Option, Some, None};
 ///
 /// Eventually, this will be implemented by default for types that implement
 /// `Eq`.
-// NOTE(stage0): remove trait after a snapshot
-#[cfg(stage0)]
-#[lang="eq"]
-#[unstable = "Definition may change slightly after trait reform"]
-pub trait PartialEq {
-    /// This method tests for `self` and `other` values to be equal, and is used by `==`.
-    fn eq(&self, other: &Self) -> bool;
-
-    /// This method tests for `!=`.
-    #[inline]
-    fn ne(&self, other: &Self) -> bool { !self.eq(other) }
-}
-
-/// Trait for values that can be compared for equality and inequality.
-///
-/// This trait allows for partial equality, for types that do not have an
-/// equivalence relation. For example, in floating point numbers `NaN != NaN`,
-/// so floating point types implement `PartialEq` but not `Eq`.
-///
-/// PartialEq only requires the `eq` method to be implemented; `ne` is defined
-/// in terms of it by default. Any manual implementation of `ne` *must* respect
-/// the rule that `eq` is a strict inverse of `ne`; that is, `!(a == b)` if and
-/// only if `a != b`.
-///
-/// Eventually, this will be implemented by default for types that implement
-/// `Eq`.
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[lang="eq"]
 #[unstable = "Definition may change slightly after trait reform"]
 pub trait PartialEq for Sized? {
@@ -102,32 +75,6 @@ pub trait PartialEq for Sized? {
 /// - reflexive: `a == a`;
 /// - symmetric: `a == b` implies `b == a`; and
 /// - transitive: `a == b` and `b == c` implies `a == c`.
-// NOTE(stage0): remove trait after a snapshot
-#[cfg(stage0)]
-#[unstable = "Definition may change slightly after trait reform"]
-pub trait Eq: PartialEq {
-    // FIXME #13101: this method is used solely by #[deriving] to
-    // assert that every component of a type implements #[deriving]
-    // itself, the current deriving infrastructure means doing this
-    // assertion without using a method on this trait is nearly
-    // impossible.
-    //
-    // This should never be implemented by hand.
-    #[doc(hidden)]
-    #[inline(always)]
-    fn assert_receiver_is_total_eq(&self) {}
-}
-
-/// Trait for equality comparisons which are [equivalence relations](
-/// https://en.wikipedia.org/wiki/Equivalence_relation).
-///
-/// This means, that in addition to `a == b` and `a != b` being strict
-/// inverses, the equality must be (for all `a`, `b` and `c`):
-///
-/// - reflexive: `a == a`;
-/// - symmetric: `a == b` implies `b == a`; and
-/// - transitive: `a == b` and `b == c` implies `a == c`.
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[unstable = "Definition may change slightly after trait reform"]
 pub trait Eq for Sized?: PartialEq {
     // FIXME #13101: this method is used solely by #[deriving] to
@@ -198,33 +145,6 @@ impl Ordering {
 ///   true; and
 /// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for
 ///   both `==` and `>`.
-// NOTE(stage0): remove trait after a snapshot
-#[cfg(stage0)]
-#[unstable = "Definition may change slightly after trait reform"]
-pub trait Ord: Eq + PartialOrd {
-    /// This method returns an ordering between `self` and `other` values.
-    ///
-    /// By convention, `self.cmp(&other)` returns the ordering matching
-    /// the expression `self <operator> other` if true.  For example:
-    ///
-    /// ```
-    /// assert_eq!( 5u.cmp(&10), Less);     // because 5 < 10
-    /// assert_eq!(10u.cmp(&5),  Greater);  // because 10 > 5
-    /// assert_eq!( 5u.cmp(&5),  Equal);    // because 5 == 5
-    /// ```
-    fn cmp(&self, other: &Self) -> Ordering;
-}
-
-/// Trait for types that form a [total order](
-/// https://en.wikipedia.org/wiki/Total_order).
-///
-/// An order is a total order if it is (for all `a`, `b` and `c`):
-///
-/// - total and antisymmetric: exactly one of `a < b`, `a == b` or `a > b` is
-///   true; and
-/// - transitive, `a < b` and `b < c` implies `a < c`. The same must hold for
-///   both `==` and `>`.
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[unstable = "Definition may change slightly after trait reform"]
 pub trait Ord for Sized?: Eq + PartialOrd {
     /// This method returns an ordering between `self` and `other` values.
@@ -268,62 +188,6 @@ impl PartialOrd for Ordering {
 /// which do not have a total order. For example, for floating point numbers,
 /// `NaN < 0 == false` and `NaN >= 0 == false` (cf. IEEE 754-2008 section
 /// 5.11).
-// NOTE(stage0): remove trait after a snapshot
-#[cfg(stage0)]
-#[lang="ord"]
-#[unstable = "Definition may change slightly after trait reform"]
-pub trait PartialOrd: PartialEq {
-    /// This method returns an ordering between `self` and `other` values
-    /// if one exists.
-    fn partial_cmp(&self, other: &Self) -> Option<Ordering>;
-
-    /// This method tests less than (for `self` and `other`) and is used by the `<` operator.
-    #[inline]
-    fn lt(&self, other: &Self) -> bool {
-        match self.partial_cmp(other) {
-            Some(Less) => true,
-            _ => false,
-        }
-    }
-
-    /// This method tests less than or equal to (`<=`).
-    #[inline]
-    fn le(&self, other: &Self) -> bool {
-        match self.partial_cmp(other) {
-            Some(Less) | Some(Equal) => true,
-            _ => false,
-        }
-    }
-
-    /// This method tests greater than (`>`).
-    #[inline]
-    fn gt(&self, other: &Self) -> bool {
-        match self.partial_cmp(other) {
-            Some(Greater) => true,
-            _ => false,
-        }
-    }
-
-    /// This method tests greater than or equal to (`>=`).
-    #[inline]
-    fn ge(&self, other: &Self) -> bool {
-        match self.partial_cmp(other) {
-            Some(Greater) | Some(Equal) => true,
-            _ => false,
-        }
-    }
-}
-
-/// Trait for values that can be compared for a sort-order.
-///
-/// PartialOrd only requires implementation of the `partial_cmp` method,
-/// with the others generated from default implementations.
-///
-/// However it remains possible to implement the others separately for types
-/// which do not have a total order. For example, for floating point numbers,
-/// `NaN < 0 == false` and `NaN >= 0 == false` (cf. IEEE 754-2008 section
-/// 5.11).
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[lang="ord"]
 #[unstable = "Definition may change slightly after trait reform"]
 pub trait PartialOrd for Sized?: PartialEq {
@@ -422,7 +286,6 @@ pub fn partial_max<T: PartialOrd>(v1: T, v2: T) -> Option<T> {
 mod impls {
     use cmp::{PartialOrd, Ord, PartialEq, Eq, Ordering,
               Less, Greater, Equal};
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     use kinds::Sized;
     use option::{Option, Some, None};
 
@@ -531,45 +394,7 @@ mod impls {
     ord_impl!(char uint u8 u16 u32 u64 int i8 i16 i32 i64)
 
     // & pointers
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: PartialEq> PartialEq for &'a T {
-        #[inline]
-        fn eq(&self, other: & &'a T) -> bool { *(*self) == *(*other) }
-        #[inline]
-        fn ne(&self, other: & &'a T) -> bool { *(*self) != *(*other) }
-    }
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: PartialOrd> PartialOrd for &'a T {
-        #[inline]
-        fn partial_cmp(&self, other: &&'a T) -> Option<Ordering> {
-            (**self).partial_cmp(*other)
-        }
-        #[inline]
-        fn lt(&self, other: & &'a T) -> bool { *(*self) < *(*other) }
-        #[inline]
-        fn le(&self, other: & &'a T) -> bool { *(*self) <= *(*other) }
-        #[inline]
-        fn ge(&self, other: & &'a T) -> bool { *(*self) >= *(*other) }
-        #[inline]
-        fn gt(&self, other: & &'a T) -> bool { *(*self) > *(*other) }
-    }
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: Ord> Ord for &'a T {
-        #[inline]
-        fn cmp(&self, other: & &'a T) -> Ordering { (**self).cmp(*other) }
-    }
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: Eq> Eq for &'a T {}
 
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: PartialEq> PartialEq for &'a T {
         #[inline]
@@ -577,7 +402,6 @@ mod impls {
         #[inline]
         fn ne(&self, other: & &'a T) -> bool { PartialEq::ne(*self, *other) }
     }
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: PartialOrd> PartialOrd for &'a T {
         #[inline]
@@ -593,56 +417,16 @@ mod impls {
         #[inline]
         fn gt(&self, other: & &'a T) -> bool { PartialOrd::gt(*self, *other) }
     }
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: Ord> Ord for &'a T {
         #[inline]
         fn cmp(&self, other: & &'a T) -> Ordering { Ord::cmp(*self, *other) }
     }
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: Eq> Eq for &'a T {}
 
     // &mut pointers
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: PartialEq> PartialEq for &'a mut T {
-        #[inline]
-        fn eq(&self, other: &&'a mut T) -> bool { **self == *(*other) }
-        #[inline]
-        fn ne(&self, other: &&'a mut T) -> bool { **self != *(*other) }
-    }
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: PartialOrd> PartialOrd for &'a mut T {
-        #[inline]
-        fn partial_cmp(&self, other: &&'a mut T) -> Option<Ordering> {
-            (**self).partial_cmp(*other)
-        }
-        #[inline]
-        fn lt(&self, other: &&'a mut T) -> bool { **self < **other }
-        #[inline]
-        fn le(&self, other: &&'a mut T) -> bool { **self <= **other }
-        #[inline]
-        fn ge(&self, other: &&'a mut T) -> bool { **self >= **other }
-        #[inline]
-        fn gt(&self, other: &&'a mut T) -> bool { **self > **other }
-    }
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: Ord> Ord for &'a mut T {
-        #[inline]
-        fn cmp(&self, other: &&'a mut T) -> Ordering { (**self).cmp(*other) }
-    }
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    #[unstable = "Trait is unstable."]
-    impl<'a, T: Eq> Eq for &'a mut T {}
 
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: PartialEq> PartialEq for &'a mut T {
         #[inline]
@@ -650,7 +434,6 @@ mod impls {
         #[inline]
         fn ne(&self, other: &&'a mut T) -> bool { PartialEq::ne(*self, *other) }
     }
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: PartialOrd> PartialOrd for &'a mut T {
         #[inline]
@@ -666,13 +449,11 @@ mod impls {
         #[inline]
         fn gt(&self, other: &&'a mut T) -> bool { PartialOrd::gt(*self, *other) }
     }
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: Ord> Ord for &'a mut T {
         #[inline]
         fn cmp(&self, other: &&'a mut T) -> Ordering { Ord::cmp(*self, *other) }
     }
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     #[unstable = "Trait is unstable."]
     impl<'a, Sized? T: Eq> Eq for &'a mut T {}
 }
diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs
index d9a0c398605..9689f7cdd71 100644
--- a/src/libcore/lib.rs
+++ b/src/libcore/lib.rs
@@ -127,7 +127,6 @@ pub mod unit;
 pub mod fmt;
 
 // note: does not need to be public
-#[cfg(not(stage0))]
 mod array;
 
 #[doc(hidden)]
diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs
index 52328a6929e..3a2e178d2ea 100644
--- a/src/libcore/ops.rs
+++ b/src/libcore/ops.rs
@@ -805,12 +805,10 @@ pub trait Deref<Sized? Result> {
     fn deref<'a>(&'a self) -> &'a Result;
 }
 
-#[cfg(not(stage0))]
 impl<'a, Sized? T> Deref<T> for &'a T {
     fn deref(&self) -> &T { *self }
 }
 
-#[cfg(not(stage0))]
 impl<'a, Sized? T> Deref<T> for &'a mut T {
     fn deref(&self) -> &T { *self }
 }
@@ -855,7 +853,6 @@ pub trait DerefMut<Sized? Result>: Deref<Result> {
     fn deref_mut<'a>(&'a mut self) -> &'a mut Result;
 }
 
-#[cfg(not(stage0))]
 impl<'a, Sized? T> DerefMut<T> for &'a mut T {
     fn deref_mut(&mut self) -> &mut T { *self }
 }
diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs
index 138422ceff1..8a70ce648d6 100644
--- a/src/libcore/slice.rs
+++ b/src/libcore/slice.rs
@@ -1661,21 +1661,6 @@ pub mod bytes {
 // Boilerplate traits
 //
 
-// NOTE(stage0): remove impl after a snapshot
-#[cfg(stage0)]
-#[unstable = "waiting for DST"]
-impl<'a,T:PartialEq> PartialEq for &'a [T] {
-    fn eq(&self, other: & &'a [T]) -> bool {
-        self.len() == other.len() &&
-            order::eq(self.iter(), other.iter())
-    }
-    fn ne(&self, other: & &'a [T]) -> bool {
-        self.len() != other.len() ||
-            order::ne(self.iter(), other.iter())
-    }
-}
-
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[unstable = "waiting for DST"]
 impl<T: PartialEq> PartialEq for [T] {
     fn eq(&self, other: &[T]) -> bool {
@@ -1688,12 +1673,6 @@ impl<T: PartialEq> PartialEq for [T] {
     }
 }
 
-// NOTE(stage0): remove impl after a snapshot
-#[cfg(stage0)]
-#[unstable = "waiting for DST"]
-impl<'a,T:Eq> Eq for &'a [T] {}
-
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[unstable = "waiting for DST"]
 impl<T: Eq> Eq for [T] {}
 
@@ -1703,41 +1682,12 @@ impl<T: PartialEq, V: AsSlice<T>> Equiv<V> for [T] {
     fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
 }
 
-// NOTE(stage0): remove impl after a snapshot
-#[cfg(stage0)]
-#[unstable = "waiting for DST"]
-impl<'a,T:PartialEq> PartialEq for &'a mut [T] {
-    fn eq(&self, other: & &'a mut [T]) -> bool {
-        self.len() == other.len() &&
-        order::eq(self.iter(), other.iter())
-    }
-    fn ne(&self, other: & &'a mut [T]) -> bool {
-        self.len() != other.len() ||
-        order::ne(self.iter(), other.iter())
-    }
-}
-
-// NOTE(stage0): remove impl after a snapshot
-#[cfg(stage0)]
-#[unstable = "waiting for DST"]
-impl<'a,T:Eq> Eq for &'a mut [T] {}
-
 #[unstable = "waiting for DST"]
 impl<'a,T:PartialEq, V: AsSlice<T>> Equiv<V> for &'a mut [T] {
     #[inline]
     fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
 }
 
-// NOTE(stage0): remove impl after a snapshot
-#[cfg(stage0)]
-#[unstable = "waiting for DST"]
-impl<'a,T:Ord> Ord for &'a [T] {
-    fn cmp(&self, other: & &'a [T]) -> Ordering {
-        order::cmp(self.iter(), other.iter())
-    }
-}
-
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[unstable = "waiting for DST"]
 impl<T: Ord> Ord for [T] {
     fn cmp(&self, other: &[T]) -> Ordering {
@@ -1745,33 +1695,6 @@ impl<T: Ord> Ord for [T] {
     }
 }
 
-// NOTE(stage0): remove impl after a snapshot
-#[cfg(stage0)]
-#[unstable = "waiting for DST"]
-impl<'a, T: PartialOrd> PartialOrd for &'a [T] {
-    #[inline]
-    fn partial_cmp(&self, other: &&'a [T]) -> Option<Ordering> {
-        order::partial_cmp(self.iter(), other.iter())
-    }
-    #[inline]
-    fn lt(&self, other: & &'a [T]) -> bool {
-        order::lt(self.iter(), other.iter())
-    }
-    #[inline]
-    fn le(&self, other: & &'a [T]) -> bool {
-        order::le(self.iter(), other.iter())
-    }
-    #[inline]
-    fn ge(&self, other: & &'a [T]) -> bool {
-        order::ge(self.iter(), other.iter())
-    }
-    #[inline]
-    fn gt(&self, other: & &'a [T]) -> bool {
-        order::gt(self.iter(), other.iter())
-    }
-}
-
-#[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
 #[unstable = "waiting for DST"]
 impl<T: PartialOrd> PartialOrd for [T] {
     #[inline]
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 4c1bfb61709..7e9d414ca53 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -1121,24 +1121,6 @@ pub mod traits {
     use ops;
     use str::{Str, StrPrelude, eq_slice};
 
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    impl<'a> Ord for &'a str {
-        #[inline]
-        fn cmp(&self, other: & &'a str) -> Ordering {
-            for (s_b, o_b) in self.bytes().zip(other.bytes()) {
-                match s_b.cmp(&o_b) {
-                    Greater => return Greater,
-                    Less => return Less,
-                    Equal => ()
-                }
-            }
-
-            self.len().cmp(&other.len())
-        }
-    }
-
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     impl Ord for str {
         #[inline]
         fn cmp(&self, other: &str) -> Ordering {
@@ -1154,18 +1136,6 @@ pub mod traits {
         }
     }
 
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    impl<'a> PartialEq for &'a str {
-        #[inline]
-        fn eq(&self, other: & &'a str) -> bool {
-            eq_slice((*self), (*other))
-        }
-        #[inline]
-        fn ne(&self, other: & &'a str) -> bool { !(*self).eq(other) }
-    }
-
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     impl PartialEq for str {
         #[inline]
         fn eq(&self, other: &str) -> bool {
@@ -1175,23 +1145,8 @@ pub mod traits {
         fn ne(&self, other: &str) -> bool { !(*self).eq(other) }
     }
 
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    impl<'a> Eq for &'a str {}
-
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     impl Eq for str {}
 
-    // NOTE(stage0): remove impl after a snapshot
-    #[cfg(stage0)]
-    impl<'a> PartialOrd for &'a str {
-        #[inline]
-        fn partial_cmp(&self, other: &&'a str) -> Option<Ordering> {
-            Some(self.cmp(other))
-        }
-    }
-
-    #[cfg(not(stage0))]  // NOTE(stage0): remove cfg after a snapshot
     impl PartialOrd for str {
         #[inline]
         fn partial_cmp(&self, other: &str) -> Option<Ordering> {