From 35275076f52d53c3dcd9dee85d92a2059a663225 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sun, 8 Mar 2015 21:59:08 +1100 Subject: [PATCH] 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`). --- src/liballoc/arc.rs | 10 +++++----- 1 file 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 @@ fn deref(&self) -> &T { } } -impl Arc { +impl Arc { /// Make a mutable reference from the given `Arc`. /// /// This is also referred to as a copy-on-write operation because the inner data is cloned if @@ -300,7 +300,7 @@ pub fn make_unique(&mut self) -> &mut T { #[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] -impl Drop for Arc { +impl Drop for Arc { /// Drops the `Arc`. /// /// This will decrement the strong reference count. If the strong reference count becomes zero @@ -367,7 +367,7 @@ fn drop(&mut self) { #[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] -impl Weak { +impl Weak { /// Upgrades a weak reference to a strong reference. /// /// Upgrades the `Weak` reference to an `Arc`, if possible. @@ -406,7 +406,7 @@ fn inner(&self) -> &ArcInner { #[unstable(feature = "alloc", reason = "Weak pointers may not belong in this module.")] -impl Clone for Weak { +impl Clone for Weak { /// Makes a clone of the `Weak`. /// /// This increases the weak reference count. @@ -430,7 +430,7 @@ fn clone(&self) -> Weak { #[unsafe_destructor] #[stable(feature = "rust1", since = "1.0.0")] -impl Drop for Weak { +impl Drop for Weak { /// Drops the `Weak`. /// /// This will decrement the weak reference count.