Skip to content

Commit 3527507

Browse files
committed
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`).
1 parent d30609f commit 3527507

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/liballoc/arc.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl<T> Deref for Arc<T> {
265265
}
266266
}
267267

268-
impl<T: Send + Sync + Clone> Arc<T> {
268+
impl<T: Clone> Arc<T> {
269269
/// Make a mutable reference from the given `Arc<T>`.
270270
///
271271
/// 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> {
300300

301301
#[unsafe_destructor]
302302
#[stable(feature = "rust1", since = "1.0.0")]
303-
impl<T: Sync + Send> Drop for Arc<T> {
303+
impl<T> Drop for Arc<T> {
304304
/// Drops the `Arc<T>`.
305305
///
306306
/// 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> {
367367

368368
#[unstable(feature = "alloc",
369369
reason = "Weak pointers may not belong in this module.")]
370-
impl<T: Sync + Send> Weak<T> {
370+
impl<T> Weak<T> {
371371
/// Upgrades a weak reference to a strong reference.
372372
///
373373
/// Upgrades the `Weak<T>` reference to an `Arc<T>`, if possible.
@@ -406,7 +406,7 @@ impl<T: Sync + Send> Weak<T> {
406406

407407
#[unstable(feature = "alloc",
408408
reason = "Weak pointers may not belong in this module.")]
409-
impl<T: Sync + Send> Clone for Weak<T> {
409+
impl<T> Clone for Weak<T> {
410410
/// Makes a clone of the `Weak<T>`.
411411
///
412412
/// This increases the weak reference count.
@@ -430,7 +430,7 @@ impl<T: Sync + Send> Clone for Weak<T> {
430430

431431
#[unsafe_destructor]
432432
#[stable(feature = "rust1", since = "1.0.0")]
433-
impl<T: Sync + Send> Drop for Weak<T> {
433+
impl<T> Drop for Weak<T> {
434434
/// Drops the `Weak<T>`.
435435
///
436436
/// This will decrement the weak reference count.

0 commit comments

Comments
 (0)