diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2013-12-30 17:49:00 -0800 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2014-01-03 14:02:00 -0800 |
| commit | b6e516859adc2eb0638a50677f73691f50ea9aca (patch) | |
| tree | 516a83ddc9ecadc3ad16b5caaaf7cd33b7080f2f | |
| parent | e095889e4edaa37ad78faa6394d0ac1d3650d64d (diff) | |
| download | rust-b6e516859adc2eb0638a50677f73691f50ea9aca.tar.gz rust-b6e516859adc2eb0638a50677f73691f50ea9aca.zip | |
libstd: Remove all support code related to `@mut`
| -rw-r--r-- | src/libextra/serialize.rs | 12 | ||||
| -rw-r--r-- | src/libstd/clone.rs | 31 | ||||
| -rw-r--r-- | src/libstd/default.rs | 4 | ||||
| -rw-r--r-- | src/libstd/managed.rs | 38 | ||||
| -rw-r--r-- | src/libstd/num/mod.rs | 5 | ||||
| -rw-r--r-- | src/libstd/repr.rs | 3 | ||||
| -rw-r--r-- | src/libstd/to_bytes.rs | 7 |
7 files changed, 0 insertions, 100 deletions
diff --git a/src/libextra/serialize.rs b/src/libextra/serialize.rs index 6b298d877da..e7ccb91fb75 100644 --- a/src/libextra/serialize.rs +++ b/src/libextra/serialize.rs @@ -426,18 +426,6 @@ impl<D:Decoder,T:Decodable<D> + 'static> Decodable<D> for @T { } } -impl<S:Encoder,T:Encodable<S>> Encodable<S> for @mut T { - fn encode(&self, s: &mut S) { - (**self).encode(s) - } -} - -impl<D:Decoder,T:Decodable<D> + 'static> Decodable<D> for @mut T { - fn decode(d: &mut D) -> @mut T { - @mut Decodable::decode(d) - } -} - impl<'a, S:Encoder,T:Encodable<S>> Encodable<S> for &'a [T] { fn encode(&self, s: &mut S) { s.emit_seq(self.len(), |s| { diff --git a/src/libstd/clone.rs b/src/libstd/clone.rs index b383c9edf36..b26ceb799a7 100644 --- a/src/libstd/clone.rs +++ b/src/libstd/clone.rs @@ -58,12 +58,6 @@ impl<T> Clone for @T { fn clone(&self) -> @T { *self } } -impl<T> Clone for @mut T { - /// Return a shallow copy of the managed box. - #[inline] - fn clone(&self) -> @mut T { *self } -} - impl<'a, T> Clone for &'a T { /// Return a shallow copy of the borrowed pointer. #[inline] @@ -168,14 +162,6 @@ impl<T: Freeze + DeepClone + 'static> DeepClone for @T { fn deep_clone(&self) -> @T { @(**self).deep_clone() } } -// FIXME: #6525: should also be implemented for `T: Send + DeepClone` -impl<T: Freeze + DeepClone + 'static> DeepClone for @mut T { - /// Return a deep copy of the managed box. The `Freeze` trait is required to prevent performing - /// a deep clone of a potentially cyclical type. - #[inline] - fn deep_clone(&self) -> @mut T { @mut (**self).deep_clone() } -} - macro_rules! deep_clone_impl( ($t:ty) => { impl DeepClone for $t { @@ -240,23 +226,6 @@ fn test_managed_clone() { } #[test] -fn test_managed_mut_deep_clone() { - let x = @mut 5i; - let y: @mut int = x.deep_clone(); - *x = 20; - assert_eq!(*y, 5); -} - -#[test] -fn test_managed_mut_clone() { - let a = @mut 5i; - let b: @mut int = a.clone(); - assert_eq!(a, b); - *b = 10; - assert_eq!(a, b); -} - -#[test] fn test_borrowed_clone() { let x = 5i; let y: &int = &x; diff --git a/src/libstd/default.rs b/src/libstd/default.rs index aaba23c683b..60f38e3b3de 100644 --- a/src/libstd/default.rs +++ b/src/libstd/default.rs @@ -16,10 +16,6 @@ pub trait Default { fn default() -> Self; } -impl<T: Default + 'static> Default for @mut T { - fn default() -> @mut T { @mut Default::default() } -} - impl<T: Default + 'static> Default for @T { fn default() -> @T { @Default::default() } } diff --git a/src/libstd/managed.rs b/src/libstd/managed.rs index 7322f0b0647..c5705665896 100644 --- a/src/libstd/managed.rs +++ b/src/libstd/managed.rs @@ -31,13 +31,6 @@ pub fn ptr_eq<T>(a: @T, b: @T) -> bool { a_ptr == b_ptr } -/// Determine if two mutable shared boxes point to the same object -#[inline] -pub fn mut_ptr_eq<T>(a: @mut T, b: @mut T) -> bool { - let (a_ptr, b_ptr): (*T, *T) = (to_unsafe_ptr(&*a), to_unsafe_ptr(&*b)); - a_ptr == b_ptr -} - #[cfg(not(test))] impl<T:Eq> Eq for @T { #[inline] @@ -47,14 +40,6 @@ impl<T:Eq> Eq for @T { } #[cfg(not(test))] -impl<T:Eq> Eq for @mut T { - #[inline] - fn eq(&self, other: &@mut T) -> bool { *(*self) == *(*other) } - #[inline] - fn ne(&self, other: &@mut T) -> bool { *(*self) != *(*other) } -} - -#[cfg(not(test))] impl<T:Ord> Ord for @T { #[inline] fn lt(&self, other: &@T) -> bool { *(*self) < *(*other) } @@ -67,40 +52,17 @@ impl<T:Ord> Ord for @T { } #[cfg(not(test))] -impl<T:Ord> Ord for @mut T { - #[inline] - fn lt(&self, other: &@mut T) -> bool { *(*self) < *(*other) } - #[inline] - fn le(&self, other: &@mut T) -> bool { *(*self) <= *(*other) } - #[inline] - fn ge(&self, other: &@mut T) -> bool { *(*self) >= *(*other) } - #[inline] - fn gt(&self, other: &@mut T) -> bool { *(*self) > *(*other) } -} - -#[cfg(not(test))] impl<T: TotalOrd> TotalOrd for @T { #[inline] fn cmp(&self, other: &@T) -> Ordering { (**self).cmp(*other) } } #[cfg(not(test))] -impl<T: TotalOrd> TotalOrd for @mut T { - #[inline] - fn cmp(&self, other: &@mut T) -> Ordering { (**self).cmp(*other) } -} - -#[cfg(not(test))] impl<T: TotalEq> TotalEq for @T { #[inline] fn equals(&self, other: &@T) -> bool { (**self).equals(*other) } } -#[cfg(not(test))] -impl<T: TotalEq> TotalEq for @mut T { - #[inline] - fn equals(&self, other: &@mut T) -> bool { (**self).equals(*other) } -} #[test] fn test() { let x = @3; diff --git a/src/libstd/num/mod.rs b/src/libstd/num/mod.rs index 8dbec0f63c6..d66d13657fc 100644 --- a/src/libstd/num/mod.rs +++ b/src/libstd/num/mod.rs @@ -1079,11 +1079,6 @@ pub fn pow_with_uint<T:NumCast+One+Zero+Div<T,T>+Mul<T,T>>(radix: uint, pow: uin total } -impl<T: Zero + 'static> Zero for @mut T { - fn zero() -> @mut T { @mut Zero::zero() } - fn is_zero(&self) -> bool { (**self).is_zero() } -} - impl<T: Zero + 'static> Zero for @T { fn zero() -> @T { @Zero::zero() } fn is_zero(&self) -> bool { (**self).is_zero() } diff --git a/src/libstd/repr.rs b/src/libstd/repr.rs index 2f9478716a3..e60abed42f2 100644 --- a/src/libstd/repr.rs +++ b/src/libstd/repr.rs @@ -655,13 +655,10 @@ fn test_repr() { exact_test(&(~"he\u10f3llo"), "~\"he\\u10f3llo\""); exact_test(&(@10), "@10"); - exact_test(&(@mut 10), "@mut 10"); - exact_test(&((@mut 10, 2)), "(@mut 10, 2)"); exact_test(&(~10), "~10"); exact_test(&(&10), "&10"); let mut x = 10; exact_test(&(&mut x), "&mut 10"); - exact_test(&(@mut [1, 2]), "@mut [1, 2]"); exact_test(&(0 as *()), "(0x0 as *())"); exact_test(&(0 as *mut ()), "(0x0 as *mut ())"); diff --git a/src/libstd/to_bytes.rs b/src/libstd/to_bytes.rs index 9de812ed385..bd1c49c6c24 100644 --- a/src/libstd/to_bytes.rs +++ b/src/libstd/to_bytes.rs @@ -319,13 +319,6 @@ impl<A:IterBytes> IterBytes for @A { } } -impl<A:IterBytes> IterBytes for @mut A { - #[inline] - fn iter_bytes(&self, lsb0: bool, f: Cb) -> bool { - (**self).iter_bytes(lsb0, f) - } -} - impl<A:IterBytes> IterBytes for Rc<A> { #[inline] fn iter_bytes(&self, lsb0: bool, f: Cb) -> bool { |
