Skip to content

Commit 64dc108

Browse files
committed
cleanup stage0 impls/cfgs
1 parent 9ce4c96 commit 64dc108

File tree

12 files changed

+6
-975
lines changed

12 files changed

+6
-975
lines changed

src/libcollections/btree/set.rs

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -448,30 +448,6 @@ impl<T: Ord> Default for BTreeSet<T> {
448448
}
449449

450450
#[unstable = "matches collection reform specification, waiting for dust to settle"]
451-
// NOTE(stage0): Remove impl after a snapshot
452-
#[cfg(stage0)]
453-
impl<T: Ord + Clone> Sub<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
454-
/// Returns the difference of `self` and `rhs` as a new `BTreeSet<T>`.
455-
///
456-
/// # Examples
457-
///
458-
/// ```
459-
/// use std::collections::BTreeSet;
460-
///
461-
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
462-
/// let b: BTreeSet<int> = vec![3,4,5].into_iter().collect();
463-
///
464-
/// let result: BTreeSet<int> = a - b;
465-
/// let result_vec: Vec<int> = result.into_iter().collect();
466-
/// assert_eq!(result_vec, vec![1,2]);
467-
/// ```
468-
fn sub(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
469-
self.difference(rhs).cloned().collect()
470-
}
471-
}
472-
473-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
474-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
475451
impl<'a, 'b, T: Ord + Clone> Sub<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeSet<T> {
476452
/// Returns the difference of `self` and `rhs` as a new `BTreeSet<T>`.
477453
///
@@ -492,31 +468,8 @@ impl<'a, 'b, T: Ord + Clone> Sub<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeSet<
492468
}
493469
}
494470

495-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
496-
// NOTE(stage0): Remove impl after a snapshot
497-
#[cfg(stage0)]
498-
impl<T: Ord + Clone> BitXor<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
499-
/// Returns the symmetric difference of `self` and `rhs` as a new `BTreeSet<T>`.
500-
///
501-
/// # Examples
502-
///
503-
/// ```
504-
/// use std::collections::BTreeSet;
505-
///
506-
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
507-
/// let b: BTreeSet<int> = vec![2,3,4].into_iter().collect();
508-
///
509-
/// let result: BTreeSet<int> = a ^ b;
510-
/// let result_vec: Vec<int> = result.into_iter().collect();
511-
/// assert_eq!(result_vec, vec![1,4]);
512-
/// ```
513-
fn bitxor(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
514-
self.symmetric_difference(rhs).cloned().collect()
515-
}
516-
}
517471

518472
#[unstable = "matches collection reform specification, waiting for dust to settle"]
519-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
520473
impl<'a, 'b, T: Ord + Clone> BitXor<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeSet<T> {
521474
/// Returns the symmetric difference of `self` and `rhs` as a new `BTreeSet<T>`.
522475
///
@@ -537,31 +490,8 @@ impl<'a, 'b, T: Ord + Clone> BitXor<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeS
537490
}
538491
}
539492

540-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
541-
// NOTE(stage0): Remove impl after a snapshot
542-
#[cfg(stage0)]
543-
impl<T: Ord + Clone> BitAnd<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
544-
/// Returns the intersection of `self` and `rhs` as a new `BTreeSet<T>`.
545-
///
546-
/// # Examples
547-
///
548-
/// ```
549-
/// use std::collections::BTreeSet;
550-
///
551-
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
552-
/// let b: BTreeSet<int> = vec![2,3,4].into_iter().collect();
553-
///
554-
/// let result: BTreeSet<int> = a & b;
555-
/// let result_vec: Vec<int> = result.into_iter().collect();
556-
/// assert_eq!(result_vec, vec![2,3]);
557-
/// ```
558-
fn bitand(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
559-
self.intersection(rhs).cloned().collect()
560-
}
561-
}
562493

563494
#[unstable = "matches collection reform specification, waiting for dust to settle"]
564-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
565495
impl<'a, 'b, T: Ord + Clone> BitAnd<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeSet<T> {
566496
/// Returns the intersection of `self` and `rhs` as a new `BTreeSet<T>`.
567497
///
@@ -582,31 +512,8 @@ impl<'a, 'b, T: Ord + Clone> BitAnd<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeS
582512
}
583513
}
584514

585-
#[unstable = "matches collection reform specification, waiting for dust to settle"]
586-
// NOTE(stage0): Remove impl after a snapshot
587-
#[cfg(stage0)]
588-
impl<T: Ord + Clone> BitOr<BTreeSet<T>,BTreeSet<T>> for BTreeSet<T> {
589-
/// Returns the union of `self` and `rhs` as a new `BTreeSet<T>`.
590-
///
591-
/// # Examples
592-
///
593-
/// ```
594-
/// use std::collections::BTreeSet;
595-
///
596-
/// let a: BTreeSet<int> = vec![1,2,3].into_iter().collect();
597-
/// let b: BTreeSet<int> = vec![3,4,5].into_iter().collect();
598-
///
599-
/// let result: BTreeSet<int> = a | b;
600-
/// let result_vec: Vec<int> = result.into_iter().collect();
601-
/// assert_eq!(result_vec, vec![1,2,3,4,5]);
602-
/// ```
603-
fn bitor(&self, rhs: &BTreeSet<T>) -> BTreeSet<T> {
604-
self.union(rhs).cloned().collect()
605-
}
606-
}
607515

608516
#[unstable = "matches collection reform specification, waiting for dust to settle"]
609-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
610517
impl<'a, 'b, T: Ord + Clone> BitOr<&'b BTreeSet<T>, BTreeSet<T>> for &'a BTreeSet<T> {
611518
/// Returns the union of `self` and `rhs` as a new `BTreeSet<T>`.
612519
///

src/libcollections/enum_set.rs

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -183,60 +183,24 @@ impl<E:CLike> EnumSet<E> {
183183
}
184184
}
185185

186-
// NOTE(stage0): Remove impl after a snapshot
187-
#[cfg(stage0)]
188-
impl<E:CLike> Sub<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
189-
fn sub(&self, e: &EnumSet<E>) -> EnumSet<E> {
190-
EnumSet {bits: self.bits & !e.bits}
191-
}
192-
}
193-
194-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
195186
impl<E:CLike> Sub<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
196187
fn sub(self, e: EnumSet<E>) -> EnumSet<E> {
197188
EnumSet {bits: self.bits & !e.bits}
198189
}
199190
}
200191

201-
// NOTE(stage0): Remove impl after a snapshot
202-
#[cfg(stage0)]
203-
impl<E:CLike> BitOr<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
204-
fn bitor(&self, e: &EnumSet<E>) -> EnumSet<E> {
205-
EnumSet {bits: self.bits | e.bits}
206-
}
207-
}
208-
209-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
210192
impl<E:CLike> BitOr<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
211193
fn bitor(self, e: EnumSet<E>) -> EnumSet<E> {
212194
EnumSet {bits: self.bits | e.bits}
213195
}
214196
}
215197

216-
// NOTE(stage0): Remove impl after a snapshot
217-
#[cfg(stage0)]
218-
impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
219-
fn bitand(&self, e: &EnumSet<E>) -> EnumSet<E> {
220-
EnumSet {bits: self.bits & e.bits}
221-
}
222-
}
223-
224-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
225198
impl<E:CLike> BitAnd<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
226199
fn bitand(self, e: EnumSet<E>) -> EnumSet<E> {
227200
EnumSet {bits: self.bits & e.bits}
228201
}
229202
}
230203

231-
// NOTE(stage0): Remove impl after a snapshot
232-
#[cfg(stage0)]
233-
impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
234-
fn bitxor(&self, e: &EnumSet<E>) -> EnumSet<E> {
235-
EnumSet {bits: self.bits ^ e.bits}
236-
}
237-
}
238-
239-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
240204
impl<E:CLike> BitXor<EnumSet<E>, EnumSet<E>> for EnumSet<E> {
241205
fn bitxor(self, e: EnumSet<E>) -> EnumSet<E> {
242206
EnumSet {bits: self.bits ^ e.bits}

src/libcollections/string.rs

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -856,36 +856,13 @@ impl<'a, S: Str> Equiv<S> for String {
856856
}
857857
}
858858

859-
// NOTE(stage0): Remove impl after a snapshot
860-
#[cfg(stage0)]
861-
#[experimental = "waiting on Add stabilization"]
862-
impl<S: Str> Add<S, String> for String {
863-
/// Concatenates `self` and `other` as a new mutable `String`.
864-
///
865-
/// # Examples
866-
///
867-
/// ```
868-
/// let string1 = "foo".to_string();
869-
/// let string2 = "bar".to_string();
870-
/// let string3 = string1 + string2;
871-
/// assert_eq!(string3, "foobar".to_string());
872-
/// ```
873-
fn add(&self, other: &S) -> String {
874-
let mut s = String::from_str(self.as_slice());
875-
s.push_str(other.as_slice());
876-
return s;
877-
}
878-
}
879-
880-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
881859
impl<'a> Add<&'a str, String> for String {
882860
fn add(mut self, other: &str) -> String {
883861
self.push_str(other);
884862
self
885863
}
886864
}
887865

888-
#[cfg(not(stage0))] // NOTE(stage0): Remove cfg after a snapshot
889866
impl<'a> Add<String, String> for &'a str {
890867
fn add(self, mut other: String) -> String {
891868
other.push_str(self);

src/libcollections/vec.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,20 +1302,6 @@ impl<T> AsSlice<T> for Vec<T> {
13021302
}
13031303
}
13041304

1305-
// NOTE(stage0): Remove impl after a snapshot
1306-
#[cfg(stage0)]
1307-
impl<T: Clone, Sized? V: AsSlice<T>> Add<V, Vec<T>> for Vec<T> {
1308-
#[inline]
1309-
fn add(&self, rhs: &V) -> Vec<T> {
1310-
let mut res = Vec::with_capacity(self.len() + rhs.as_slice().len());
1311-
res.push_all(self.as_slice());
1312-
res.push_all(rhs.as_slice());
1313-
res
1314-
}
1315-
}
1316-
1317-
1318-
#[cfg(not(stage0))] // NOTE(stage0): Remove impl after a snapshot
13191305
impl<'a, T: Clone> Add<&'a [T], Vec<T>> for Vec<T> {
13201306
#[inline]
13211307
fn add(mut self, rhs: &[T]) -> Vec<T> {
@@ -1324,7 +1310,6 @@ impl<'a, T: Clone> Add<&'a [T], Vec<T>> for Vec<T> {
13241310
}
13251311
}
13261312

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

0 commit comments

Comments
 (0)