diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-03-08 21:59:08 +1100 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-03-08 21:59:08 +1100 |
| commit | 35275076f52d53c3dcd9dee85d92a2059a663225 (patch) | |
| tree | 4e53f9025fffb3d35ea8fde533fd12073da19365 /src/liballoc | |
| parent | d30609ffd782c941f38d62caaed8beb6fde965db (diff) | |
| download | rust-35275076f52d53c3dcd9dee85d92a2059a663225.tar.gz rust-35275076f52d53c3dcd9dee85d92a2059a663225.zip | |
Remove unneeded `T: Send + Sync` bounds from `Arc`.
The requirement `T: Send + Sync` only matters if the `Arc` crosses thread boundaries, and that is adequately controlled by the impls of `Send`/`Sync` for `Arc` itself. If `T` doesn't satisfy the bounds, then the `Arc` cannot cross thread boundaries and so everything is still safe (`Arc` just acts like an expensive `Rc`).
Diffstat (limited to 'src/liballoc')
| -rw-r--r-- | src/liballoc/arc.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/liballoc/arc.rs b/src/liballoc/arc.rs index dc1938cac1a..ce25f907ec2 100644 --- a/src/liballoc/arc.rs +++ b/src/liballoc/arc.rs @@ -265,7 +265,7 @@ impl<T> Deref for Arc<T> { } } -impl<T: Send + Sync + Clone> Arc<T> { +impl<T: Clone> Arc<T> { /// Make a mutable reference from the given `Arc<T>`. /// /// This is also referred to as a copy-on-write operation because the inner data is cloned if @@ -300,7 +300,7 @@ impl<T: Send + Sync + Clone> Arc<T> { #[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] -impl<T: Sync + Send> Drop for Arc<T> { +impl<T> Drop for Arc<T> { /// Drops the `Arc<T>`. /// /// This will decrement the strong reference count. If the strong reference count becomes zero @@ -367,7 +367,7 @@ impl<T: Sync + Send> Drop for Arc<T> { #[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] -impl<T: Sync + Send> Weak<T> { +impl<T> Weak<T> { /// Upgrades a weak reference to a strong reference. /// /// Upgrades the `Weak<T>` reference to an `Arc<T>`, if possible. @@ -406,7 +406,7 @@ impl<T: Sync + Send> Weak<T> { #[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] -impl<T: Sync + Send> Clone for Weak<T> { +impl<T> Clone for Weak<T> { /// Makes a clone of the `Weak<T>`. /// /// This increases the weak reference count. @@ -430,7 +430,7 @@ impl<T: Sync + Send> Clone for Weak<T> { #[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] -impl<T: Sync + Send> Drop for Weak<T> { +impl<T> Drop for Weak<T> { /// Drops the `Weak<T>`. /// /// This will decrement the weak reference count. |
