about summary refs log tree commit diff
path: root/src/libstd/vec.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-02-01 11:16:24 -0800
committerbors <bors@rust-lang.org>2014-02-01 11:16:24 -0800
commit2bcd951749b67402ccaa31f1bb0349656f880fe2 (patch)
treebb3de89383f032ca622a27e20e237282c9569a48 /src/libstd/vec.rs
parent60ffbeb2a495d097e38f51348ebcf5a884947c25 (diff)
parent212507413a2768ec4b6a072dde73d60527c2beee (diff)
downloadrust-2bcd951749b67402ccaa31f1bb0349656f880fe2.tar.gz
rust-2bcd951749b67402ccaa31f1bb0349656f880fe2.zip
auto merge of #11974 : huonw/rust/no-at-vec, r=pcwalton
This removes @[] from the parser as well as much of the handling of it (and `@str`) from the compiler as I can find.

I've just rebased @pcwalton's (already reviewed) `@str` removal (and fixed the problems in a separate commit); the only new work is the trailing commits with my authorship.

Closes #11967 
Diffstat (limited to 'src/libstd/vec.rs')
-rw-r--r--src/libstd/vec.rs60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs
index 7e4405fd545..607b30c000b 100644
--- a/src/libstd/vec.rs
+++ b/src/libstd/vec.rs
@@ -646,13 +646,6 @@ pub mod traits {
         fn ne(&self, other: &~[T]) -> bool { !self.eq(other) }
     }
 
-    impl<T:Eq> Eq for @[T] {
-        #[inline]
-        fn eq(&self, other: &@[T]) -> bool { self.as_slice() == *other }
-        #[inline]
-        fn ne(&self, other: &@[T]) -> bool { !self.eq(other) }
-    }
-
     impl<'a,T:TotalEq> TotalEq for &'a [T] {
         fn equals(&self, other: & &'a [T]) -> bool {
             self.len() == other.len() &&
@@ -665,11 +658,6 @@ pub mod traits {
         fn equals(&self, other: &~[T]) -> bool { self.as_slice().equals(&other.as_slice()) }
     }
 
-    impl<T:TotalEq> TotalEq for @[T] {
-        #[inline]
-        fn equals(&self, other: &@[T]) -> bool { self.as_slice().equals(&other.as_slice()) }
-    }
-
     impl<'a,T:Eq, V: Vector<T>> Equiv<V> for &'a [T] {
         #[inline]
         fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
@@ -680,11 +668,6 @@ pub mod traits {
         fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
     }
 
-    impl<'a,T:Eq, V: Vector<T>> Equiv<V> for @[T] {
-        #[inline]
-        fn equiv(&self, other: &V) -> bool { self.as_slice() == other.as_slice() }
-    }
-
     impl<'a,T:TotalOrd> TotalOrd for &'a [T] {
         fn cmp(&self, other: & &'a [T]) -> Ordering {
             order::cmp(self.iter(), other.iter())
@@ -696,11 +679,6 @@ pub mod traits {
         fn cmp(&self, other: &~[T]) -> Ordering { self.as_slice().cmp(&other.as_slice()) }
     }
 
-    impl<T: TotalOrd> TotalOrd for @[T] {
-        #[inline]
-        fn cmp(&self, other: &@[T]) -> Ordering { self.as_slice().cmp(&other.as_slice()) }
-    }
-
     impl<'a, T: Eq + Ord> Ord for &'a [T] {
         fn lt(&self, other: & &'a [T]) -> bool {
             order::lt(self.iter(), other.iter())
@@ -730,17 +708,6 @@ pub mod traits {
         fn gt(&self, other: &~[T]) -> bool { self.as_slice() > other.as_slice() }
     }
 
-    impl<T: Eq + Ord> Ord for @[T] {
-        #[inline]
-        fn lt(&self, other: &@[T]) -> bool { self.as_slice() < other.as_slice() }
-        #[inline]
-        fn le(&self, other: &@[T]) -> bool { self.as_slice() <= other.as_slice() }
-        #[inline]
-        fn ge(&self, other: &@[T]) -> bool { self.as_slice() >= other.as_slice() }
-        #[inline]
-        fn gt(&self, other: &@[T]) -> bool { self.as_slice() > other.as_slice() }
-    }
-
     impl<'a,T:Clone, V: Vector<T>> Add<V, ~[T]> for &'a [T] {
         #[inline]
         fn add(&self, rhs: &V) -> ~[T] {
@@ -778,11 +745,6 @@ impl<T> Vector<T> for ~[T] {
     fn as_slice<'a>(&'a self) -> &'a [T] { let v: &'a [T] = *self; v }
 }
 
-impl<T> Vector<T> for @[T] {
-    #[inline(always)]
-    fn as_slice<'a>(&'a self) -> &'a [T] { let v: &'a [T] = *self; v }
-}
-
 impl<'a, T> Container for &'a [T] {
     /// Returns the length of a vector
     #[inline]
@@ -833,15 +795,6 @@ impl<T: Clone> CloneableVector<T> for ~[T] {
     fn into_owned(self) -> ~[T] { self }
 }
 
-/// Extension methods for managed vectors
-impl<T: Clone> CloneableVector<T> for @[T] {
-    #[inline]
-    fn to_owned(&self) -> ~[T] { self.as_slice().to_owned() }
-
-    #[inline(always)]
-    fn into_owned(self) -> ~[T] { self.to_owned() }
-}
-
 /// Extension methods for vectors
 pub trait ImmutableVector<'a, T> {
     /**
@@ -2637,10 +2590,6 @@ impl<A> Default for ~[A] {
     fn default() -> ~[A] { ~[] }
 }
 
-impl<A> Default for @[A] {
-    fn default() -> @[A] { @[] }
-}
-
 macro_rules! iterator {
     (struct $name:ident -> $ptr:ty, $elem:ty) => {
         /// An iterator for iterating over a vector.
@@ -3117,14 +3066,6 @@ mod tests {
         assert_eq!(v_b[0], 2);
         assert_eq!(v_b[1], 3);
 
-        // Test on managed heap.
-        let vec_managed = @[1, 2, 3, 4, 5];
-        let v_c = vec_managed.slice(0u, 3u).to_owned();
-        assert_eq!(v_c.len(), 3u);
-        assert_eq!(v_c[0], 1);
-        assert_eq!(v_c[1], 2);
-        assert_eq!(v_c[2], 3);
-
         // Test on exchange heap.
         let vec_unique = ~[1, 2, 3, 4, 5, 6];
         let v_d = vec_unique.slice(1u, 6u).to_owned();
@@ -4060,7 +4001,6 @@ mod tests {
         );
 
         t!(&[int]);
-        t!(@[int]);
         t!(~[int]);
     }