From 84086c464f537591f0e4629676b3fc75517492ab Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 17 Dec 2014 23:02:47 -0800 Subject: [PATCH] Register new snapshots This does not yet start the movement to rustc-serialize. That detail is left to a future PR. --- src/libcollections/btree/set.rs | 96 ------- src/libcollections/enum_set.rs | 36 --- src/libcollections/string.rs | 22 -- src/libcollections/vec.rs | 15 - src/libcore/ops.rs | 437 ----------------------------- src/librustc/middle/ty.rs | 27 -- src/libstd/bitflags.rs | 44 --- src/libstd/time/duration.rs | 64 ----- src/libsyntax/codemap.rs | 36 --- src/libsyntax/ext/tt/transcribe.rs | 24 -- src/libtime/lib.rs | 34 --- src/snapshots.txt | 9 + 12 files changed, 9 insertions(+), 835 deletions(-) diff --git a/src/libcollections/btree/set.rs b/src/libcollections/btree/set.rs index 4ef2e681992..ef7b3fbf599 100644 --- a/src/libcollections/btree/set.rs +++ b/src/libcollections/btree/set.rs @@ -448,30 +448,6 @@ impl Default for BTreeSet { } #[unstable = "matches collection reform specification, waiting for dust to settle"] -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Sub,BTreeSet> for BTreeSet { - /// Returns the difference of `self` and `rhs` as a new `BTreeSet`. - /// - /// # Examples - /// - /// ``` - /// use std::collections::BTreeSet; - /// - /// let a: BTreeSet = vec![1,2,3].into_iter().collect(); - /// let b: BTreeSet = vec![3,4,5].into_iter().collect(); - /// - /// let result: BTreeSet = a - b; - /// let result_vec: Vec = result.into_iter().collect(); - /// assert_eq!(result_vec, vec![1,2]); - /// ``` - fn sub(&self, rhs: &BTreeSet) -> BTreeSet { - self.difference(rhs).cloned().collect() - } -} - -#[unstable = "matches collection reform specification, waiting for dust to settle"] -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl<'a, 'b, T: Ord + Clone> Sub<&'b BTreeSet, BTreeSet> for &'a BTreeSet { /// Returns the difference of `self` and `rhs` as a new `BTreeSet`. /// @@ -493,30 +469,6 @@ impl<'a, 'b, T: Ord + Clone> Sub<&'b BTreeSet, BTreeSet> for &'a BTreeSet< } #[unstable = "matches collection reform specification, waiting for dust to settle"] -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl BitXor,BTreeSet> for BTreeSet { - /// Returns the symmetric difference of `self` and `rhs` as a new `BTreeSet`. - /// - /// # Examples - /// - /// ``` - /// use std::collections::BTreeSet; - /// - /// let a: BTreeSet = vec![1,2,3].into_iter().collect(); - /// let b: BTreeSet = vec![2,3,4].into_iter().collect(); - /// - /// let result: BTreeSet = a ^ b; - /// let result_vec: Vec = result.into_iter().collect(); - /// assert_eq!(result_vec, vec![1,4]); - /// ``` - fn bitxor(&self, rhs: &BTreeSet) -> BTreeSet { - self.symmetric_difference(rhs).cloned().collect() - } -} - -#[unstable = "matches collection reform specification, waiting for dust to settle"] -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl<'a, 'b, T: Ord + Clone> BitXor<&'b BTreeSet, BTreeSet> for &'a BTreeSet { /// Returns the symmetric difference of `self` and `rhs` as a new `BTreeSet`. /// @@ -538,30 +490,6 @@ impl<'a, 'b, T: Ord + Clone> BitXor<&'b BTreeSet, BTreeSet> for &'a BTreeS } #[unstable = "matches collection reform specification, waiting for dust to settle"] -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl BitAnd,BTreeSet> for BTreeSet { - /// Returns the intersection of `self` and `rhs` as a new `BTreeSet`. - /// - /// # Examples - /// - /// ``` - /// use std::collections::BTreeSet; - /// - /// let a: BTreeSet = vec![1,2,3].into_iter().collect(); - /// let b: BTreeSet = vec![2,3,4].into_iter().collect(); - /// - /// let result: BTreeSet = a & b; - /// let result_vec: Vec = result.into_iter().collect(); - /// assert_eq!(result_vec, vec![2,3]); - /// ``` - fn bitand(&self, rhs: &BTreeSet) -> BTreeSet { - self.intersection(rhs).cloned().collect() - } -} - -#[unstable = "matches collection reform specification, waiting for dust to settle"] -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl<'a, 'b, T: Ord + Clone> BitAnd<&'b BTreeSet, BTreeSet> for &'a BTreeSet { /// Returns the intersection of `self` and `rhs` as a new `BTreeSet`. /// @@ -583,30 +511,6 @@ impl<'a, 'b, T: Ord + Clone> BitAnd<&'b BTreeSet, BTreeSet> for &'a BTreeS } #[unstable = "matches collection reform specification, waiting for dust to settle"] -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl BitOr,BTreeSet> for BTreeSet { - /// Returns the union of `self` and `rhs` as a new `BTreeSet`. - /// - /// # Examples - /// - /// ``` - /// use std::collections::BTreeSet; - /// - /// let a: BTreeSet = vec![1,2,3].into_iter().collect(); - /// let b: BTreeSet = vec![3,4,5].into_iter().collect(); - /// - /// let result: BTreeSet = a | b; - /// let result_vec: Vec = result.into_iter().collect(); - /// assert_eq!(result_vec, vec![1,2,3,4,5]); - /// ``` - fn bitor(&self, rhs: &BTreeSet) -> BTreeSet { - self.union(rhs).cloned().collect() - } -} - -#[unstable = "matches collection reform specification, waiting for dust to settle"] -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl<'a, 'b, T: Ord + Clone> BitOr<&'b BTreeSet, BTreeSet> for &'a BTreeSet { /// Returns the union of `self` and `rhs` as a new `BTreeSet`. /// diff --git a/src/libcollections/enum_set.rs b/src/libcollections/enum_set.rs index 49b66ce25f5..554d642c638 100644 --- a/src/libcollections/enum_set.rs +++ b/src/libcollections/enum_set.rs @@ -183,60 +183,24 @@ impl EnumSet { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Sub, EnumSet> for EnumSet { - fn sub(&self, e: &EnumSet) -> EnumSet { - EnumSet {bits: self.bits & !e.bits} - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Sub, EnumSet> for EnumSet { fn sub(self, e: EnumSet) -> EnumSet { EnumSet {bits: self.bits & !e.bits} } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl BitOr, EnumSet> for EnumSet { - fn bitor(&self, e: &EnumSet) -> EnumSet { - EnumSet {bits: self.bits | e.bits} - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl BitOr, EnumSet> for EnumSet { fn bitor(self, e: EnumSet) -> EnumSet { EnumSet {bits: self.bits | e.bits} } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl BitAnd, EnumSet> for EnumSet { - fn bitand(&self, e: &EnumSet) -> EnumSet { - EnumSet {bits: self.bits & e.bits} - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl BitAnd, EnumSet> for EnumSet { fn bitand(self, e: EnumSet) -> EnumSet { EnumSet {bits: self.bits & e.bits} } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl BitXor, EnumSet> for EnumSet { - fn bitxor(&self, e: &EnumSet) -> EnumSet { - EnumSet {bits: self.bits ^ e.bits} - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl BitXor, EnumSet> for EnumSet { fn bitxor(self, e: EnumSet) -> EnumSet { EnumSet {bits: self.bits ^ e.bits} diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 38ebd686ddb..b897f9b8df3 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -856,28 +856,7 @@ impl<'a, S: Str> Equiv for String { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] #[experimental = "waiting on Add stabilization"] -impl Add for String { - /// Concatenates `self` and `other` as a new mutable `String`. - /// - /// # Examples - /// - /// ``` - /// let string1 = "foo".to_string(); - /// let string2 = "bar".to_string(); - /// let string3 = string1 + string2; - /// assert_eq!(string3, "foobar".to_string()); - /// ``` - fn add(&self, other: &S) -> String { - let mut s = String::from_str(self.as_slice()); - s.push_str(other.as_slice()); - return s; - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl<'a> Add<&'a str, String> for String { fn add(mut self, other: &str) -> String { self.push_str(other); @@ -885,7 +864,6 @@ impl<'a> Add<&'a str, String> for String { } } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl<'a> Add for &'a str { fn add(self, mut other: String) -> String { other.push_str(self); diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 94e6103f05f..ffb4955c8fd 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -1313,20 +1313,6 @@ impl AsSlice for Vec { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl> Add> for Vec { - #[inline] - fn add(&self, rhs: &V) -> Vec { - let mut res = Vec::with_capacity(self.len() + rhs.as_slice().len()); - res.push_all(self.as_slice()); - res.push_all(rhs.as_slice()); - res - } -} - - -#[cfg(not(stage0))] // NOTE(stage0): Remove impl after a snapshot impl<'a, T: Clone> Add<&'a [T], Vec> for Vec { #[inline] fn add(mut self, rhs: &[T]) -> Vec { @@ -1335,7 +1321,6 @@ impl<'a, T: Clone> Add<&'a [T], Vec> for Vec { } } -#[cfg(not(stage0))] // NOTE(stage0): Remove impl after a snapshot impl<'a, T: Clone> Add, Vec> for &'a [T] { #[inline] fn add(self, mut rhs: Vec) -> Vec { diff --git a/src/libcore/ops.rs b/src/libcore/ops.rs index 0090da3cdad..dd5cffeab03 100644 --- a/src/libcore/ops.rs +++ b/src/libcore/ops.rs @@ -93,46 +93,6 @@ pub trait Drop { /// impl Copy for Foo {} /// /// impl Add for Foo { -/// fn add(&self, _rhs: &Foo) -> Foo { -/// println!("Adding!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo + Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="add"] -pub trait Add for Sized? { - /// The method for the `+` operator - fn add(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! add_impl { - ($($t:ty)*) => ($( - impl Add<$t, $t> for $t { - #[inline] - fn add(&self, other: &$t) -> $t { (*self) + (*other) } - } - )*) -} - -/// The `Add` trait is used to specify the functionality of `+`. -/// -/// # Example -/// -/// A trivial implementation of `Add`. When `Foo + Foo` happens, it ends up -/// calling `add`, and therefore, `main` prints `Adding!`. -/// -/// ```rust -/// struct Foo; -/// -/// impl Add for Foo { /// fn add(self, _rhs: Foo) -> Foo { /// println!("Adding!"); /// self @@ -143,14 +103,12 @@ macro_rules! add_impl { /// Foo + Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="add"] pub trait Add { /// The method for the `+` operator fn add(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! add_impl { ($($t:ty)*) => ($( impl Add<$t, $t> for $t { @@ -175,46 +133,6 @@ add_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// impl Copy for Foo {} /// /// impl Sub for Foo { -/// fn sub(&self, _rhs: &Foo) -> Foo { -/// println!("Subtracting!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo - Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="sub"] -pub trait Sub for Sized? { - /// The method for the `-` operator - fn sub(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! sub_impl { - ($($t:ty)*) => ($( - impl Sub<$t, $t> for $t { - #[inline] - fn sub(&self, other: &$t) -> $t { (*self) - (*other) } - } - )*) -} - -/// The `Sub` trait is used to specify the functionality of `-`. -/// -/// # Example -/// -/// A trivial implementation of `Sub`. When `Foo - Foo` happens, it ends up -/// calling `sub`, and therefore, `main` prints `Subtracting!`. -/// -/// ```rust -/// struct Foo; -/// -/// impl Sub for Foo { /// fn sub(self, _rhs: Foo) -> Foo { /// println!("Subtracting!"); /// self @@ -225,14 +143,12 @@ macro_rules! sub_impl { /// Foo - Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="sub"] pub trait Sub { /// The method for the `-` operator fn sub(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! sub_impl { ($($t:ty)*) => ($( impl Sub<$t, $t> for $t { @@ -257,46 +173,6 @@ sub_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// impl Copy for Foo {} /// /// impl Mul for Foo { -/// fn mul(&self, _rhs: &Foo) -> Foo { -/// println!("Multiplying!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo * Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="mul"] -pub trait Mul for Sized? { - /// The method for the `*` operator - fn mul(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! mul_impl { - ($($t:ty)*) => ($( - impl Mul<$t, $t> for $t { - #[inline] - fn mul(&self, other: &$t) -> $t { (*self) * (*other) } - } - )*) -} - -/// The `Mul` trait is used to specify the functionality of `*`. -/// -/// # Example -/// -/// A trivial implementation of `Mul`. When `Foo * Foo` happens, it ends up -/// calling `mul`, and therefore, `main` prints `Multiplying!`. -/// -/// ```rust -/// struct Foo; -/// -/// impl Mul for Foo { /// fn mul(self, _rhs: Foo) -> Foo { /// println!("Multiplying!"); /// self @@ -307,14 +183,12 @@ macro_rules! mul_impl { /// Foo * Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="mul"] pub trait Mul { /// The method for the `*` operator fn mul(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! mul_impl { ($($t:ty)*) => ($( impl Mul<$t, $t> for $t { @@ -339,46 +213,6 @@ mul_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// impl Copy for Foo {} /// /// impl Div for Foo { -/// fn div(&self, _rhs: &Foo) -> Foo { -/// println!("Dividing!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo / Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="div"] -pub trait Div for Sized? { - /// The method for the `/` operator - fn div(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! div_impl { - ($($t:ty)*) => ($( - impl Div<$t, $t> for $t { - #[inline] - fn div(&self, other: &$t) -> $t { (*self) / (*other) } - } - )*) -} - -/// The `Div` trait is used to specify the functionality of `/`. -/// -/// # Example -/// -/// A trivial implementation of `Div`. When `Foo / Foo` happens, it ends up -/// calling `div`, and therefore, `main` prints `Dividing!`. -/// -/// ``` -/// struct Foo; -/// -/// impl Div for Foo { /// fn div(self, _rhs: Foo) -> Foo { /// println!("Dividing!"); /// self @@ -389,14 +223,12 @@ macro_rules! div_impl { /// Foo / Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="div"] pub trait Div { /// The method for the `/` operator fn div(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! div_impl { ($($t:ty)*) => ($( impl Div<$t, $t> for $t { @@ -421,60 +253,6 @@ div_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 f32 f64 } /// impl Copy for Foo {} /// /// impl Rem for Foo { -/// fn rem(&self, _rhs: &Foo) -> Foo { -/// println!("Remainder-ing!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo % Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="rem"] -pub trait Rem for Sized? { - /// The method for the `%` operator - fn rem(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! rem_impl { - ($($t:ty)*) => ($( - impl Rem<$t, $t> for $t { - #[inline] - fn rem(&self, other: &$t) -> $t { (*self) % (*other) } - } - )*) -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! rem_float_impl { - ($t:ty, $fmod:ident) => { - impl Rem<$t, $t> for $t { - #[inline] - fn rem(&self, other: &$t) -> $t { - extern { fn $fmod(a: $t, b: $t) -> $t; } - unsafe { $fmod(*self, *other) } - } - } - } -} - -/// The `Rem` trait is used to specify the functionality of `%`. -/// -/// # Example -/// -/// A trivial implementation of `Rem`. When `Foo % Foo` happens, it ends up -/// calling `rem`, and therefore, `main` prints `Remainder-ing!`. -/// -/// ``` -/// struct Foo; -/// -/// impl Rem for Foo { /// fn rem(self, _rhs: Foo) -> Foo { /// println!("Remainder-ing!"); /// self @@ -485,14 +263,12 @@ macro_rules! rem_float_impl { /// Foo % Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="rem"] pub trait Rem { /// The method for the `%` operator fn rem(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! rem_impl { ($($t:ty)*) => ($( impl Rem<$t, $t> for $t { @@ -502,7 +278,6 @@ macro_rules! rem_impl { )*) } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! rem_float_impl { ($t:ty, $fmod:ident) => { impl Rem<$t, $t> for $t { @@ -729,46 +504,6 @@ not_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// impl Copy for Foo {} /// /// impl BitAnd for Foo { -/// fn bitand(&self, _rhs: &Foo) -> Foo { -/// println!("Bitwise And-ing!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo & Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="bitand"] -pub trait BitAnd for Sized? { - /// The method for the `&` operator - fn bitand(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! bitand_impl { - ($($t:ty)*) => ($( - impl BitAnd<$t, $t> for $t { - #[inline] - fn bitand(&self, rhs: &$t) -> $t { (*self) & (*rhs) } - } - )*) -} - -/// The `BitAnd` trait is used to specify the functionality of `&`. -/// -/// # Example -/// -/// A trivial implementation of `BitAnd`. When `Foo & Foo` happens, it ends up -/// calling `bitand`, and therefore, `main` prints `Bitwise And-ing!`. -/// -/// ``` -/// struct Foo; -/// -/// impl BitAnd for Foo { /// fn bitand(self, _rhs: Foo) -> Foo { /// println!("Bitwise And-ing!"); /// self @@ -779,14 +514,12 @@ macro_rules! bitand_impl { /// Foo & Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="bitand"] pub trait BitAnd { /// The method for the `&` operator fn bitand(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! bitand_impl { ($($t:ty)*) => ($( impl BitAnd<$t, $t> for $t { @@ -811,46 +544,6 @@ bitand_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// impl Copy for Foo {} /// /// impl BitOr for Foo { -/// fn bitor(&self, _rhs: &Foo) -> Foo { -/// println!("Bitwise Or-ing!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo | Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="bitor"] -pub trait BitOr for Sized? { - /// The method for the `|` operator - fn bitor(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! bitor_impl { - ($($t:ty)*) => ($( - impl BitOr<$t,$t> for $t { - #[inline] - fn bitor(&self, rhs: &$t) -> $t { (*self) | (*rhs) } - } - )*) -} - -/// The `BitOr` trait is used to specify the functionality of `|`. -/// -/// # Example -/// -/// A trivial implementation of `BitOr`. When `Foo | Foo` happens, it ends up -/// calling `bitor`, and therefore, `main` prints `Bitwise Or-ing!`. -/// -/// ``` -/// struct Foo; -/// -/// impl BitOr for Foo { /// fn bitor(self, _rhs: Foo) -> Foo { /// println!("Bitwise Or-ing!"); /// self @@ -861,14 +554,12 @@ macro_rules! bitor_impl { /// Foo | Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="bitor"] pub trait BitOr { /// The method for the `|` operator fn bitor(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! bitor_impl { ($($t:ty)*) => ($( impl BitOr<$t,$t> for $t { @@ -893,46 +584,6 @@ bitor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// impl Copy for Foo {} /// /// impl BitXor for Foo { -/// fn bitxor(&self, _rhs: &Foo) -> Foo { -/// println!("Bitwise Xor-ing!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo ^ Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="bitxor"] -pub trait BitXor for Sized? { - /// The method for the `^` operator - fn bitxor(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! bitxor_impl { - ($($t:ty)*) => ($( - impl BitXor<$t, $t> for $t { - #[inline] - fn bitxor(&self, other: &$t) -> $t { (*self) ^ (*other) } - } - )*) -} - -/// The `BitXor` trait is used to specify the functionality of `^`. -/// -/// # Example -/// -/// A trivial implementation of `BitXor`. When `Foo ^ Foo` happens, it ends up -/// calling `bitxor`, and therefore, `main` prints `Bitwise Xor-ing!`. -/// -/// ``` -/// struct Foo; -/// -/// impl BitXor for Foo { /// fn bitxor(self, _rhs: Foo) -> Foo { /// println!("Bitwise Xor-ing!"); /// self @@ -943,14 +594,12 @@ macro_rules! bitxor_impl { /// Foo ^ Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="bitxor"] pub trait BitXor { /// The method for the `^` operator fn bitxor(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! bitxor_impl { ($($t:ty)*) => ($( impl BitXor<$t, $t> for $t { @@ -975,48 +624,6 @@ bitxor_impl! { bool uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// impl Copy for Foo {} /// /// impl Shl for Foo { -/// fn shl(&self, _rhs: &Foo) -> Foo { -/// println!("Shifting left!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo << Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="shl"] -pub trait Shl for Sized? { - /// The method for the `<<` operator - fn shl(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! shl_impl { - ($($t:ty)*) => ($( - impl Shl for $t { - #[inline] - fn shl(&self, other: &uint) -> $t { - (*self) << (*other) - } - } - )*) -} - -/// The `Shl` trait is used to specify the functionality of `<<`. -/// -/// # Example -/// -/// A trivial implementation of `Shl`. When `Foo << Foo` happens, it ends up -/// calling `shl`, and therefore, `main` prints `Shifting left!`. -/// -/// ``` -/// struct Foo; -/// -/// impl Shl for Foo { /// fn shl(self, _rhs: Foo) -> Foo { /// println!("Shifting left!"); /// self @@ -1027,14 +634,12 @@ macro_rules! shl_impl { /// Foo << Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="shl"] pub trait Shl { /// The method for the `<<` operator fn shl(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! shl_impl { ($($t:ty)*) => ($( impl Shl for $t { @@ -1061,46 +666,6 @@ shl_impl! { uint u8 u16 u32 u64 int i8 i16 i32 i64 } /// impl Copy for Foo {} /// /// impl Shr for Foo { -/// fn shr(&self, _rhs: &Foo) -> Foo { -/// println!("Shifting right!"); -/// *self -/// } -/// } -/// -/// fn main() { -/// Foo >> Foo; -/// } -/// ``` -// NOTE(stage0): Remove trait after a snapshot -#[cfg(stage0)] -#[lang="shr"] -pub trait Shr for Sized? { - /// The method for the `>>` operator - fn shr(&self, rhs: &RHS) -> Result; -} - -// NOTE(stage0): Remove macro after a snapshot -#[cfg(stage0)] -macro_rules! shr_impl { - ($($t:ty)*) => ($( - impl Shr for $t { - #[inline] - fn shr(&self, other: &uint) -> $t { (*self) >> (*other) } - } - )*) -} - -/// The `Shr` trait is used to specify the functionality of `>>`. -/// -/// # Example -/// -/// A trivial implementation of `Shr`. When `Foo >> Foo` happens, it ends up -/// calling `shr`, and therefore, `main` prints `Shifting right!`. -/// -/// ``` -/// struct Foo; -/// -/// impl Shr for Foo { /// fn shr(self, _rhs: Foo) -> Foo { /// println!("Shifting right!"); /// self @@ -1111,14 +676,12 @@ macro_rules! shr_impl { /// Foo >> Foo; /// } /// ``` -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot #[lang="shr"] pub trait Shr { /// The method for the `>>` operator fn shr(self, rhs: RHS) -> Result; } -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot macro_rules! shr_impl { ($($t:ty)*) => ($( impl Shr for $t { diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 6839e8bcc45..ab3a959d9a7 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -2922,45 +2922,18 @@ impl TypeContents { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl ops::BitOr for TypeContents { - fn bitor(&self, other: &TypeContents) -> TypeContents { - TypeContents {bits: self.bits | other.bits} - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl ops::BitOr for TypeContents { fn bitor(self, other: TypeContents) -> TypeContents { TypeContents {bits: self.bits | other.bits} } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl ops::BitAnd for TypeContents { - fn bitand(&self, other: &TypeContents) -> TypeContents { - TypeContents {bits: self.bits & other.bits} - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl ops::BitAnd for TypeContents { fn bitand(self, other: TypeContents) -> TypeContents { TypeContents {bits: self.bits & other.bits} } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl ops::Sub for TypeContents { - fn sub(&self, other: &TypeContents) -> TypeContents { - TypeContents {bits: self.bits & !other.bits} - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl ops::Sub for TypeContents { fn sub(self, other: TypeContents) -> TypeContents { TypeContents {bits: self.bits & !other.bits} diff --git a/src/libstd/bitflags.rs b/src/libstd/bitflags.rs index f467b77dbf4..89aa4b3c9e9 100644 --- a/src/libstd/bitflags.rs +++ b/src/libstd/bitflags.rs @@ -205,17 +205,6 @@ macro_rules! bitflags { } } - // NOTE(stage0): Remove impl after a snapshot - #[cfg(stage0)] - impl BitOr<$BitFlags, $BitFlags> for $BitFlags { - /// Returns the union of the two sets of flags. - #[inline] - fn bitor(&self, other: &$BitFlags) -> $BitFlags { - $BitFlags { bits: self.bits | other.bits } - } - } - - #[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl BitOr<$BitFlags, $BitFlags> for $BitFlags { /// Returns the union of the two sets of flags. #[inline] @@ -224,17 +213,6 @@ macro_rules! bitflags { } } - // NOTE(stage0): Remove impl after a snapshot - #[cfg(stage0)] - impl BitXor<$BitFlags, $BitFlags> for $BitFlags { - /// Returns the left flags, but with all the right flags toggled. - #[inline] - fn bitxor(&self, other: &$BitFlags) -> $BitFlags { - $BitFlags { bits: self.bits ^ other.bits } - } - } - - #[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl BitXor<$BitFlags, $BitFlags> for $BitFlags { /// Returns the left flags, but with all the right flags toggled. #[inline] @@ -243,17 +221,6 @@ macro_rules! bitflags { } } - // NOTE(stage0): Remove impl after a snapshot - #[cfg(stage0)] - impl BitAnd<$BitFlags, $BitFlags> for $BitFlags { - /// Returns the intersection between the two sets of flags. - #[inline] - fn bitand(&self, other: &$BitFlags) -> $BitFlags { - $BitFlags { bits: self.bits & other.bits } - } - } - - #[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl BitAnd<$BitFlags, $BitFlags> for $BitFlags { /// Returns the intersection between the two sets of flags. #[inline] @@ -262,17 +229,6 @@ macro_rules! bitflags { } } - // NOTE(stage0): Remove impl after a snapshot - #[cfg(stage0)] - impl Sub<$BitFlags, $BitFlags> for $BitFlags { - /// Returns the set difference of the two sets of flags. - #[inline] - fn sub(&self, other: &$BitFlags) -> $BitFlags { - $BitFlags { bits: self.bits & !other.bits } - } - } - - #[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Sub<$BitFlags, $BitFlags> for $BitFlags { /// Returns the set difference of the two sets of flags. #[inline] diff --git a/src/libstd/time/duration.rs b/src/libstd/time/duration.rs index 85ed27853c4..1d4fd38d48a 100644 --- a/src/libstd/time/duration.rs +++ b/src/libstd/time/duration.rs @@ -290,21 +290,6 @@ impl Neg for Duration { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Add for Duration { - fn add(&self, rhs: &Duration) -> Duration { - let mut secs = self.secs + rhs.secs; - let mut nanos = self.nanos + rhs.nanos; - if nanos >= NANOS_PER_SEC { - nanos -= NANOS_PER_SEC; - secs += 1; - } - Duration { secs: secs, nanos: nanos } - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Add for Duration { fn add(self, rhs: Duration) -> Duration { let mut secs = self.secs + rhs.secs; @@ -317,21 +302,6 @@ impl Add for Duration { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Sub for Duration { - fn sub(&self, rhs: &Duration) -> Duration { - let mut secs = self.secs - rhs.secs; - let mut nanos = self.nanos - rhs.nanos; - if nanos < 0 { - nanos += NANOS_PER_SEC; - secs -= 1; - } - Duration { secs: secs, nanos: nanos } - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Sub for Duration { fn sub(self, rhs: Duration) -> Duration { let mut secs = self.secs - rhs.secs; @@ -344,19 +314,6 @@ impl Sub for Duration { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Mul for Duration { - fn mul(&self, rhs: &i32) -> Duration { - // Multiply nanoseconds as i64, because it cannot overflow that way. - let total_nanos = self.nanos as i64 * *rhs as i64; - let (extra_secs, nanos) = div_mod_floor_64(total_nanos, NANOS_PER_SEC as i64); - let secs = self.secs * *rhs as i64 + extra_secs; - Duration { secs: secs, nanos: nanos as i32 } - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Mul for Duration { fn mul(self, rhs: i32) -> Duration { // Multiply nanoseconds as i64, because it cannot overflow that way. @@ -367,27 +324,6 @@ impl Mul for Duration { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Div for Duration { - fn div(&self, rhs: &i32) -> Duration { - let mut secs = self.secs / *rhs as i64; - let carry = self.secs - secs * *rhs as i64; - let extra_nanos = carry * NANOS_PER_SEC as i64 / *rhs as i64; - let mut nanos = self.nanos / *rhs + extra_nanos as i32; - if nanos >= NANOS_PER_SEC { - nanos -= NANOS_PER_SEC; - secs += 1; - } - if nanos < 0 { - nanos += NANOS_PER_SEC; - secs -= 1; - } - Duration { secs: secs, nanos: nanos } - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Div for Duration { fn div(self, rhs: i32) -> Duration { let mut secs = self.secs / rhs as i64; diff --git a/src/libsyntax/codemap.rs b/src/libsyntax/codemap.rs index 17cafc2441f..eae41a21e7d 100644 --- a/src/libsyntax/codemap.rs +++ b/src/libsyntax/codemap.rs @@ -52,30 +52,12 @@ impl Pos for BytePos { fn to_uint(&self) -> uint { let BytePos(n) = *self; n as uint } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Add for BytePos { - fn add(&self, rhs: &BytePos) -> BytePos { - BytePos((self.to_uint() + rhs.to_uint()) as u32) - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Add for BytePos { fn add(self, rhs: BytePos) -> BytePos { BytePos((self.to_uint() + rhs.to_uint()) as u32) } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Sub for BytePos { - fn sub(&self, rhs: &BytePos) -> BytePos { - BytePos((self.to_uint() - rhs.to_uint()) as u32) - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Sub for BytePos { fn sub(self, rhs: BytePos) -> BytePos { BytePos((self.to_uint() - rhs.to_uint()) as u32) @@ -87,30 +69,12 @@ impl Pos for CharPos { fn to_uint(&self) -> uint { let CharPos(n) = *self; n } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Add for CharPos { - fn add(&self, rhs: &CharPos) -> CharPos { - CharPos(self.to_uint() + rhs.to_uint()) - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Add for CharPos { fn add(self, rhs: CharPos) -> CharPos { CharPos(self.to_uint() + rhs.to_uint()) } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Sub for CharPos { - fn sub(&self, rhs: &CharPos) -> CharPos { - CharPos(self.to_uint() - rhs.to_uint()) - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Sub for CharPos { fn sub(self, rhs: CharPos) -> CharPos { CharPos(self.to_uint() - rhs.to_uint()) diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs index e2439bad178..378dbba07fa 100644 --- a/src/libsyntax/ext/tt/transcribe.rs +++ b/src/libsyntax/ext/tt/transcribe.rs @@ -106,30 +106,6 @@ enum LockstepIterSize { LisContradiction(String), } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Add for LockstepIterSize { - fn add(&self, other: &LockstepIterSize) -> LockstepIterSize { - match *self { - LisUnconstrained => other.clone(), - LisContradiction(_) => self.clone(), - LisConstraint(l_len, l_id) => match *other { - LisUnconstrained => self.clone(), - LisContradiction(_) => other.clone(), - LisConstraint(r_len, _) if l_len == r_len => self.clone(), - LisConstraint(r_len, r_id) => { - let l_n = token::get_ident(l_id); - let r_n = token::get_ident(r_id); - LisContradiction(format!("inconsistent lockstep iteration: \ - '{}' has {} items, but '{}' has {}", - l_n, l_len, r_n, r_len).to_string()) - } - }, - } - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Add for LockstepIterSize { fn add(self, other: LockstepIterSize) -> LockstepIterSize { match self { diff --git a/src/libtime/lib.rs b/src/libtime/lib.rs index 4129086e9ec..bbeddcd263b 100644 --- a/src/libtime/lib.rs +++ b/src/libtime/lib.rs @@ -99,29 +99,6 @@ impl Timespec { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Add for Timespec { - fn add(&self, other: &Duration) -> Timespec { - let d_sec = other.num_seconds(); - // It is safe to unwrap the nanoseconds, because there cannot be - // more than one second left, which fits in i64 and in i32. - let d_nsec = (*other - Duration::seconds(d_sec)) - .num_nanoseconds().unwrap() as i32; - let mut sec = self.sec + d_sec; - let mut nsec = self.nsec + d_nsec; - if nsec >= NSEC_PER_SEC { - nsec -= NSEC_PER_SEC; - sec += 1; - } else if nsec < 0 { - nsec += NSEC_PER_SEC; - sec -= 1; - } - Timespec::new(sec, nsec) - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Add for Timespec { fn add(self, other: Duration) -> Timespec { let d_sec = other.num_seconds(); @@ -142,17 +119,6 @@ impl Add for Timespec { } } -// NOTE(stage0): Remove impl after a snapshot -#[cfg(stage0)] -impl Sub for Timespec { - fn sub(&self, other: &Timespec) -> Duration { - let sec = self.sec - other.sec; - let nsec = self.nsec - other.nsec; - Duration::seconds(sec) + Duration::nanoseconds(nsec as i64) - } -} - -#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot impl Sub for Timespec { fn sub(self, other: Timespec) -> Duration { let sec = self.sec - other.sec; diff --git a/src/snapshots.txt b/src/snapshots.txt index 071d9f758eb..b85ff194c7c 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,12 @@ +S 2014-12-17 22a9f25 + freebsd-x86_64 c6a13ad985e8464fef0fc7cb7e0d221cbb4815a9 + linux-i386 03109a02e2ed6cd2bb982e93814ef555d54b55a6 + linux-x86_64 0cdf84d5f2fa7cd6b9e321150c6cfc7334206163 + macos-i386 384406ebaa2a2065a801733f4cb3f53d96a0a73d + macos-x86_64 b00e10f44b348da454ad602a921213d8170148b3 + winnt-i386 3d6b0f333d142d99f21506dcea5f03d428ddec12 + winnt-x86_64 f8cbf77146d7ddcc5f8388c58c090f31e78de317 + S 2014-12-15 1b97cd3 freebsd-x86_64 a5d7ff81ec04e01e64dc201c7aa2d875ebd0cbbb linux-i386 47e13c2f1d26a0d13e593e0881a80ca103aa7b2e