Skip to content

Create a snapshot for 8443b09 #20090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -448,30 +448,6 @@ impl<T: Ord> Default for BTreeSet<T> {
}

#[unstable = "matches collection reform specification, waiting for dust to settle"]
// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<T: Ord + Clone> Sub<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
/// Returns the difference of `self` and `rhs` as a new `BTreeSet<T>`.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
/// let b: BTreeSet<int> = vec![3,4,5].into_iter().collect();
///
/// let result: BTreeSet<int> = a - b;
/// let result_vec: Vec<int> = result.into_iter().collect();
/// assert_eq!(result_vec, vec![1,2]);
/// ```
fn sub(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
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<T>, BTreeSet<T>> for &'a BTreeSet<T> {
/// Returns the difference of `self` and `rhs` as a new `BTreeSet<T>`.
///
Expand All @@ -492,31 +468,8 @@ impl<'a, 'b, T: Ord + Clone> Sub<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeSet<
}
}

#[unstable = "matches collection reform specification, waiting for dust to settle"]
// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<T: Ord + Clone> BitXor<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
/// Returns the symmetric difference of `self` and `rhs` as a new `BTreeSet<T>`.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
/// let b: BTreeSet<int> = vec![2,3,4].into_iter().collect();
///
/// let result: BTreeSet<int> = a ^ b;
/// let result_vec: Vec<int> = result.into_iter().collect();
/// assert_eq!(result_vec, vec![1,4]);
/// ```
fn bitxor(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
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<T>, BTreeSet<T>> for &'a BTreeSet<T> {
/// Returns the symmetric difference of `self` and `rhs` as a new `BTreeSet<T>`.
///
Expand All @@ -537,31 +490,8 @@ impl<'a, 'b, T: Ord + Clone> BitXor<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeS
}
}

#[unstable = "matches collection reform specification, waiting for dust to settle"]
// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<T: Ord + Clone> BitAnd<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
/// Returns the intersection of `self` and `rhs` as a new `BTreeSet<T>`.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
/// let b: BTreeSet<int> = vec![2,3,4].into_iter().collect();
///
/// let result: BTreeSet<int> = a & b;
/// let result_vec: Vec<int> = result.into_iter().collect();
/// assert_eq!(result_vec, vec![2,3]);
/// ```
fn bitand(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
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<T>, BTreeSet<T>> for &'a BTreeSet<T> {
/// Returns the intersection of `self` and `rhs` as a new `BTreeSet<T>`.
///
Expand All @@ -582,31 +512,8 @@ impl<'a, 'b, T: Ord + Clone> BitAnd<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeS
}
}

#[unstable = "matches collection reform specification, waiting for dust to settle"]
// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<T: Ord + Clone> BitOr<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
/// Returns the union of `self` and `rhs` as a new `BTreeSet<T>`.
///
/// # Examples
///
/// ```
/// use std::collections::BTreeSet;
///
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
/// let b: BTreeSet<int> = vec![3,4,5].into_iter().collect();
///
/// let result: BTreeSet<int> = a | b;
/// let result_vec: Vec<int> = result.into_iter().collect();
/// assert_eq!(result_vec, vec![1,2,3,4,5]);
/// ```
fn bitor(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
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<T>, BTreeSet<T>> for &'a BTreeSet<T> {
/// Returns the union of `self` and `rhs` as a new `BTreeSet<T>`.
///
Expand Down
36 changes: 0 additions & 36 deletions src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,60 +183,24 @@ impl<E:CLike> EnumSet<E> {
}
}

// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<E:CLike> Sub<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn sub(&self, e: &EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits & !e.bits}
}
}

#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
impl<E:CLike> Sub<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn sub(self, e: EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits & !e.bits}
}
}

// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<E:CLike> BitOr<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitor(&self, e: &EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits | e.bits}
}
}

#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
impl<E:CLike> BitOr<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitor(self, e: EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits | e.bits}
}
}

// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitand(&self, e: &EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits & e.bits}
}
}

#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitand(self, e: EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits & e.bits}
}
}

// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitxor(&self, e: &EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits ^ e.bits}
}
}

#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
fn bitxor(self, e: EnumSet<E>) -> EnumSet<E> {
EnumSet {bits: self.bits ^ e.bits}
Expand Down
23 changes: 0 additions & 23 deletions src/libcollections/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -856,36 +856,13 @@ impl<'a, S: Str> Equiv<S> for String {
}
}

// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
#[experimental = "waiting on Add stabilization"]
impl<S: Str> Add<S, String> 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);
self
}
}

#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
impl<'a> Add<String, String> for &'a str {
fn add(self, mut other: String) -> String {
other.push_str(self);
Expand Down
15 changes: 0 additions & 15 deletions src/libcollections/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1302,20 +1302,6 @@ impl<T> AsSlice<T> for Vec<T> {
}
}

// NOTE(stage0): Remove impl after a snapshot
#[cfg(stage0)]
impl<T: Clone, Sized? V: AsSlice<T>> Add<V, Vec<T>> for Vec<T> {
#[inline]
fn add(&self, rhs: &V) -> Vec<T> {
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<T>> for Vec<T> {
#[inline]
fn add(mut self, rhs: &[T]) -> Vec<T> {
Expand All @@ -1324,7 +1310,6 @@ impl<'a, T: Clone> Add<&'a [T], Vec<T>> for Vec<T> {
}
}

#[cfg(not(stage0))] // NOTE(stage0): Remove impl after a snapshot
impl<'a, T: Clone> Add<Vec<T>, Vec<T>> for &'a [T] {
#[inline]
fn add(self, mut rhs: Vec<T>) -> Vec<T> {
Expand Down
Loading