From 065e39bb2fd439d792d8a8f72a7182dfc8b7c5a3 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 12 Nov 2014 12:17:55 -0800 Subject: [PATCH] Register new snapshots --- src/liballoc/boxed.rs | 40 ----- src/libcollections/str.rs | 7 - src/libcollections/vec.rs | 14 -- src/libcore/cmp.rs | 219 --------------------------- src/libcore/lib.rs | 1 - src/libcore/ops.rs | 3 - src/libcore/slice.rs | 77 ---------- src/libcore/str.rs | 45 ------ src/libgraphviz/maybe_owned_vec.rs | 12 -- src/libregex/parse.rs | 10 -- src/librustc/driver/mod.rs | 28 ---- src/librustrt/c_str.rs | 7 - src/libserialize/json.rs | 38 ----- src/libstd/collections/hash/table.rs | 23 --- src/libsyntax/util/interner.rs | 6 - src/libtest/lib.rs | 50 ------ src/snapshots.txt | 9 ++ 17 files changed, 9 insertions(+), 580 deletions(-) diff --git a/src/liballoc/boxed.rs b/src/liballoc/boxed.rs index 0a06f7c0005fd..26f8522e1c18a 100644 --- a/src/liballoc/boxed.rs +++ b/src/liballoc/boxed.rs @@ -65,50 +65,12 @@ impl Clone for Box { } } -// NOTE(stage0): remove impl after a snapshot -#[cfg(stage0)] -impl PartialEq for Box { - #[inline] - fn eq(&self, other: &Box) -> bool { *(*self) == *(*other) } - #[inline] - fn ne(&self, other: &Box) -> bool { *(*self) != *(*other) } -} -// NOTE(stage0): remove impl after a snapshot -#[cfg(stage0)] -impl PartialOrd for Box { - #[inline] - fn partial_cmp(&self, other: &Box) -> Option { - (**self).partial_cmp(&**other) - } - #[inline] - fn lt(&self, other: &Box) -> bool { *(*self) < *(*other) } - #[inline] - fn le(&self, other: &Box) -> bool { *(*self) <= *(*other) } - #[inline] - fn ge(&self, other: &Box) -> bool { *(*self) >= *(*other) } - #[inline] - fn gt(&self, other: &Box) -> bool { *(*self) > *(*other) } -} -// NOTE(stage0): remove impl after a snapshot -#[cfg(stage0)] -impl Ord for Box { - #[inline] - fn cmp(&self, other: &Box) -> Ordering { - (**self).cmp(&**other) - } -} -// NOTE(stage0): remove impl after a snapshot -#[cfg(stage0)] -impl Eq for Box {} - -#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot impl PartialEq for Box { #[inline] fn eq(&self, other: &Box) -> bool { PartialEq::eq(&**self, &**other) } #[inline] fn ne(&self, other: &Box) -> bool { PartialEq::ne(&**self, &**other) } } -#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot impl PartialOrd for Box { #[inline] fn partial_cmp(&self, other: &Box) -> Option { @@ -123,14 +85,12 @@ impl PartialOrd for Box { #[inline] fn gt(&self, other: &Box) -> bool { PartialOrd::gt(&**self, &**other) } } -#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot impl Ord for Box { #[inline] fn cmp(&self, other: &Box) -> Ordering { Ord::cmp(&**self, &**other) } } -#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot impl Eq for Box {} /// Extension methods for an owning `Any` trait object. diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 04fc85091faa0..20aa29fbb3dcc 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -534,13 +534,6 @@ impl<'a> PartialOrd for MaybeOwned<'a> { } impl<'a> Ord for MaybeOwned<'a> { - // NOTE(stage0): remove method after a snapshot - #[cfg(stage0)] - #[inline] - fn cmp(&self, other: &MaybeOwned) -> Ordering { - self.as_slice().cmp(&other.as_slice()) - } - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot #[inline] fn cmp(&self, other: &MaybeOwned) -> Ordering { self.as_slice().cmp(other.as_slice()) diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 0e3799ed9ac37..9958943a70c49 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -506,13 +506,6 @@ impl PartialEq for Vec { #[unstable = "waiting on PartialOrd stability"] impl PartialOrd for Vec { - // NOTE(stage0): remove method after a snapshot - #[cfg(stage0)] - #[inline] - fn partial_cmp(&self, other: &Vec) -> Option { - self.as_slice().partial_cmp(&other.as_slice()) - } - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot #[inline] fn partial_cmp(&self, other: &Vec) -> Option { self.as_slice().partial_cmp(other.as_slice()) @@ -530,13 +523,6 @@ impl> Equiv for Vec { #[unstable = "waiting on Ord stability"] impl Ord for Vec { - // NOTE(stage0): remove method after a snapshot - #[cfg(stage0)] - #[inline] - fn cmp(&self, other: &Vec) -> Ordering { - self.as_slice().cmp(&other.as_slice()) - } - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot #[inline] fn cmp(&self, other: &Vec) -> Ordering { self.as_slice().cmp(other.as_slice()) diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index 6e87fe4ced02d..078cfce128edd 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 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; - - /// 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(v1: T, v2: T) -> Option { 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 { - (**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 { - (**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 d9a0c398605e1..9689f7cdd7114 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 52328a6929e20..3a2e178d2ea0a 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -805,12 +805,10 @@ pub trait Deref { fn deref<'a>(&'a self) -> &'a Result; } -#[cfg(not(stage0))] impl<'a, Sized? T> Deref for &'a T { fn deref(&self) -> &T { *self } } -#[cfg(not(stage0))] impl<'a, Sized? T> Deref for &'a mut T { fn deref(&self) -> &T { *self } } @@ -855,7 +853,6 @@ pub trait DerefMut: Deref { fn deref_mut<'a>(&'a mut self) -> &'a mut Result; } -#[cfg(not(stage0))] impl<'a, Sized? T> DerefMut 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 138422ceff1ce..8a70ce648d662 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 PartialEq for [T] { fn eq(&self, other: &[T]) -> bool { @@ -1688,12 +1673,6 @@ impl 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 Eq for [T] {} @@ -1703,41 +1682,12 @@ impl> Equiv 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> Equiv 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 Ord for [T] { fn cmp(&self, other: &[T]) -> Ordering { @@ -1745,33 +1695,6 @@ impl 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 { - 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 PartialOrd for [T] { #[inline] diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 4c1bfb6170907..7e9d414ca5393 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 { - 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 { diff --git a/src/libgraphviz/maybe_owned_vec.rs b/src/libgraphviz/maybe_owned_vec.rs index 2c516affeb274..d091a98933c09 100644 --- a/src/libgraphviz/maybe_owned_vec.rs +++ b/src/libgraphviz/maybe_owned_vec.rs @@ -76,24 +76,12 @@ impl<'a, T: PartialEq> PartialEq for MaybeOwnedVector<'a, T> { impl<'a, T: Eq> Eq for MaybeOwnedVector<'a, T> {} impl<'a, T: PartialOrd> PartialOrd for MaybeOwnedVector<'a, T> { - // NOTE(stage0): remove method after a snapshot - #[cfg(stage0)] - fn partial_cmp(&self, other: &MaybeOwnedVector) -> Option { - self.as_slice().partial_cmp(&other.as_slice()) - } - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot fn partial_cmp(&self, other: &MaybeOwnedVector) -> Option { self.as_slice().partial_cmp(other.as_slice()) } } impl<'a, T: Ord> Ord for MaybeOwnedVector<'a, T> { - // NOTE(stage0): remove method after a snapshot - #[cfg(stage0)] - fn cmp(&self, other: &MaybeOwnedVector) -> Ordering { - self.as_slice().cmp(&other.as_slice()) - } - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot fn cmp(&self, other: &MaybeOwnedVector) -> Ordering { self.as_slice().cmp(other.as_slice()) } diff --git a/src/libregex/parse.rs b/src/libregex/parse.rs index 6723ea725a356..ba3134d7d1619 100644 --- a/src/libregex/parse.rs +++ b/src/libregex/parse.rs @@ -1020,16 +1020,6 @@ fn is_valid_cap(c: char) -> bool { || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') } -// NOTE(stage0): remove function after a snapshot -#[cfg(stage0)] -fn find_class(classes: NamedClasses, name: &str) -> Option> { - match classes.binary_search(|&(s, _)| s.cmp(&name)) { - slice::Found(i) => Some(classes[i].val1().to_vec()), - slice::NotFound(_) => None, - } -} - -#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot fn find_class(classes: NamedClasses, name: &str) -> Option> { match classes.binary_search(|&(s, _)| s.cmp(name)) { slice::Found(i) => Some(classes[i].val1().to_vec()), diff --git a/src/librustc/driver/mod.rs b/src/librustc/driver/mod.rs index 8753795d9e25d..edd82b42876aa 100644 --- a/src/librustc/driver/mod.rs +++ b/src/librustc/driver/mod.rs @@ -182,21 +182,6 @@ Available lint options: "); - // NOTE(stage0): remove function after a snapshot - #[cfg(stage0)] - fn sort_lints(lints: Vec<(&'static Lint, bool)>) -> Vec<&'static Lint> { - let mut lints: Vec<_> = lints.into_iter().map(|(x, _)| x).collect(); - lints.sort_by(|x: &&Lint, y: &&Lint| { - match x.default_level.cmp(&y.default_level) { - // The sort doesn't case-fold but it's doubtful we care. - Equal => x.name.cmp(&y.name), - r => r, - } - }); - lints - } - - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot fn sort_lints(lints: Vec<(&'static Lint, bool)>) -> Vec<&'static Lint> { let mut lints: Vec<_> = lints.into_iter().map(|(x, _)| x).collect(); lints.sort_by(|x: &&Lint, y: &&Lint| { @@ -209,19 +194,6 @@ Available lint options: lints } - // NOTE(stage0): remove function after a snapshot - #[cfg(stage0)] - fn sort_lint_groups(lints: Vec<(&'static str, Vec, bool)>) - -> Vec<(&'static str, Vec)> { - let mut lints: Vec<_> = lints.into_iter().map(|(x, y, _)| (x, y)).collect(); - lints.sort_by(|&(x, _): &(&'static str, Vec), - &(y, _): &(&'static str, Vec)| { - x.cmp(&y) - }); - lints - } - - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot fn sort_lint_groups(lints: Vec<(&'static str, Vec, bool)>) -> Vec<(&'static str, Vec)> { let mut lints: Vec<_> = lints.into_iter().map(|(x, y, _)| (x, y)).collect(); diff --git a/src/librustrt/c_str.rs b/src/librustrt/c_str.rs index 68c2d2031c48d..21186a5ac3089 100644 --- a/src/librustrt/c_str.rs +++ b/src/librustrt/c_str.rs @@ -121,13 +121,6 @@ impl PartialEq for CString { } impl PartialOrd for CString { - // NOTE(stage0): remove method after a snapshot - #[cfg(stage0)] - #[inline] - fn partial_cmp(&self, other: &CString) -> Option { - self.as_bytes().partial_cmp(&other.as_bytes()) - } - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot #[inline] fn partial_cmp(&self, other: &CString) -> Option { self.as_bytes().partial_cmp(other.as_bytes()) diff --git a/src/libserialize/json.rs b/src/libserialize/json.rs index 7731351758558..0b557b9142fa1 100644 --- a/src/libserialize/json.rs +++ b/src/libserialize/json.rs @@ -890,18 +890,6 @@ impl Json { /// If the Json value is an Object, returns the value associated with the provided key. /// Otherwise, returns None. - // NOTE(stage0): remove function after a snapshot - #[cfg(stage0)] - pub fn find<'a>(&'a self, key: &str) -> Option<&'a Json>{ - match self { - &Object(ref map) => map.find_with(|s| key.cmp(&s.as_slice())), - _ => None - } - } - - /// If the Json value is an Object, returns the value associated with the provided key. - /// Otherwise, returns None. - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot pub fn find<'a>(&'a self, key: &str) -> Option<&'a Json>{ match self { &Object(ref map) => map.find_with(|s| key.cmp(s.as_slice())), @@ -926,32 +914,6 @@ impl Json { /// If the Json value is an Object, performs a depth-first search until /// a value associated with the provided key is found. If no value is found /// or the Json value is not an Object, returns None. - // NOTE(stage0): remove function after a snapshot - #[cfg(stage0)] - pub fn search<'a>(&'a self, key: &str) -> Option<&'a Json> { - match self { - &Object(ref map) => { - match map.find_with(|s| key.cmp(&s.as_slice())) { - Some(json_value) => Some(json_value), - None => { - for (_, v) in map.iter() { - match v.search(key) { - x if x.is_some() => return x, - _ => () - } - } - None - } - } - }, - _ => None - } - } - - /// If the Json value is an Object, performs a depth-first search until - /// a value associated with the provided key is found. If no value is found - /// or the Json value is not an Object, returns None. - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot pub fn search<'a>(&'a self, key: &str) -> Option<&'a Json> { match self { &Object(ref map) => { diff --git a/src/libstd/collections/hash/table.rs b/src/libstd/collections/hash/table.rs index fd964cdf02c53..da670d5a3e5dc 100644 --- a/src/libstd/collections/hash/table.rs +++ b/src/libstd/collections/hash/table.rs @@ -165,29 +165,6 @@ impl RawBucket { } } -// For parameterizing over mutability. - -#[cfg(stage0)] -impl<'t, K, V> Deref> for &'t RawTable { - fn deref(&self) -> &RawTable { - &**self - } -} - -#[cfg(stage0)] -impl<'t, K, V> Deref> for &'t mut RawTable { - fn deref(&self) -> &RawTable { - &**self - } -} - -#[cfg(stage0)] -impl<'t, K, V> DerefMut> for &'t mut RawTable { - fn deref_mut(&mut self) -> &mut RawTable { - &mut **self - } -} - // Buckets hold references to the table. impl FullBucket { /// Borrow a reference to the table. diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index bc6d6d7a5216d..7588d15b678a3 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -97,12 +97,6 @@ pub struct RcStr { impl Eq for RcStr {} impl Ord for RcStr { - // NOTE(stage0): remove method after a snapshot - #[cfg(stage0)] - fn cmp(&self, other: &RcStr) -> Ordering { - self.as_slice().cmp(&other.as_slice()) - } - #[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot fn cmp(&self, other: &RcStr) -> Ordering { self.as_slice().cmp(other.as_slice()) } diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 4d6aefb2a178d..78f88fa1b5857 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -973,56 +973,6 @@ fn get_concurrency() -> uint { } } -// NOTE(stage0): remove function after a snapshot -#[cfg(stage0)] -pub fn filter_tests(opts: &TestOpts, tests: Vec) -> Vec { - let mut filtered = tests; - - // Remove tests that don't match the test filter - filtered = match opts.filter { - None => filtered, - Some(ref re) => { - filtered.into_iter() - .filter(|test| re.is_match(test.desc.name.as_slice())).collect() - } - }; - - // Maybe pull out the ignored test and unignore them - filtered = if !opts.run_ignored { - filtered - } else { - fn filter(test: TestDescAndFn) -> Option { - if test.desc.ignore { - let TestDescAndFn {desc, testfn} = test; - Some(TestDescAndFn { - desc: TestDesc {ignore: false, ..desc}, - testfn: testfn - }) - } else { - None - } - }; - filtered.into_iter().filter_map(|x| filter(x)).collect() - }; - - // Sort the tests alphabetically - filtered.sort_by(|t1, t2| t1.desc.name.as_slice().cmp(&t2.desc.name.as_slice())); - - // Shard the remaining tests, if sharding requested. - match opts.test_shard { - None => filtered, - Some((a,b)) => { - filtered.into_iter().enumerate() - // note: using a - 1 so that the valid shards, for example, are - // 1.2 and 2.2 instead of 0.2 and 1.2 - .filter(|&(i,_)| i % b == (a - 1)) - .map(|(_,t)| t) - .collect() - } - } -} - -#[cfg(not(stage0))] // NOTE(stage0): remove cfg after a snapshot pub fn filter_tests(opts: &TestOpts, tests: Vec) -> Vec { let mut filtered = tests; diff --git a/src/snapshots.txt b/src/snapshots.txt index 2c32e0e1643f5..f679be2cbdbcd 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,12 @@ +S 2014-11-10 f89e975 + freebsd-x86_64 52702569e3c3361d6fd96968443791e76bed18e3 + linux-i386 3f8bb33f86800affca3cb7245925c19b28a94498 + linux-x86_64 e0e13a4312bea0bcc7db35b46bcce957178b18a4 + macos-i386 22f084aaecb773e8348c64fb9ac6d5eba363eb56 + macos-x86_64 c8554badab19cee96fbf51c2b98ee1bba87caa5c + winnt-i386 936bd7a60bce83208d34f2369a0178937e140fba + winnt-x86_64 09ba12dc41b7305d3f15ca27ec8d0a5a2a64b204 + S 2014-11-04 1b2ad78 freebsd-x86_64 f8c41a522d6a3c9691a0865dab170dcb988e9141 linux-i386 d827fbbd778b854923971873cf03bdb79c2e8575