Skip to content

Commit 1228360

Browse files
authored
Rollup merge of #161429 - maxdexh:allocator-arc-sync-send, r=nia-e
Tighten allocator `Send`/`Sync` requirements for `Arc` in preparation for refactor Fixes some of the changes from #161115 to the `Send` and `Sync` bounds on the allocator in `Arc`, so that we can move the allocator inside `ArcInner` later, like we plan to once the ongoing work (#132553) on it has been completed. r? nia-e
2 parents fc0db65 + 595ce4c commit 1228360

2 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎library/alloc/src/rc.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -344,10 +344,7 @@ impl<T: ?Sized, A: Allocator> !Sync for Rc<T, A> {}
344344
#[stable(feature = "catch_unwind", since = "1.9.0")]
345345
impl<T: RefUnwindSafe + ?Sized, A: Allocator + UnwindSafe + RefUnwindSafe> UnwindSafe for Rc<T, A> {}
346346
#[stable(feature = "rc_ref_unwind_safe", since = "1.58.0")]
347-
impl<T: RefUnwindSafe + ?Sized, A: Allocator + UnwindSafe + RefUnwindSafe> RefUnwindSafe
348-
for Rc<T, A>
349-
{
350-
}
347+
impl<T: RefUnwindSafe + ?Sized, A: Allocator + RefUnwindSafe> RefUnwindSafe for Rc<T, A> {}
351348

352349
#[unstable(feature = "coerce_unsized", issue = "18598")]
353350
impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Rc<U, A>> for Rc<T, A> {}

‎library/alloc/src/sync.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub struct Arc<
283283
#[stable(feature = "rust1", since = "1.0.0")]
284284
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Send + Sync> Send for Arc<T, A> {}
285285
#[stable(feature = "rust1", since = "1.0.0")]
286-
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Sync> Sync for Arc<T, A> {}
286+
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Send + Sync> Sync for Arc<T, A> {}
287287

288288
#[stable(feature = "catch_unwind", since = "1.9.0")]
289289
impl<T: RefUnwindSafe + ?Sized, A: Allocator + UnwindSafe + RefUnwindSafe> UnwindSafe
@@ -369,7 +369,7 @@ pub struct Weak<
369369
#[stable(feature = "arc_weak", since = "1.4.0")]
370370
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Send + Sync> Send for Weak<T, A> {}
371371
#[stable(feature = "arc_weak", since = "1.4.0")]
372-
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Sync> Sync for Weak<T, A> {}
372+
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Send + Sync> Sync for Weak<T, A> {}
373373

374374
#[unstable(feature = "coerce_unsized", issue = "18598")]
375375
impl<T: ?Sized + Unsize<U>, U: ?Sized, A: Allocator> CoerceUnsized<Weak<U, A>> for Weak<T, A> {}
@@ -4429,7 +4429,7 @@ pub struct UniqueArc<
44294429
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Send + Sync> Send for UniqueArc<T, A> {}
44304430

44314431
#[unstable(feature = "unique_rc_arc", issue = "112566")]
4432-
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Sync> Sync for UniqueArc<T, A> {}
4432+
unsafe impl<T: ?Sized + Sync + Send, A: Allocator + Send + Sync> Sync for UniqueArc<T, A> {}
44334433

44344434
#[unstable(feature = "unique_rc_arc", issue = "112566")]
44354435
// #[unstable(feature = "coerce_unsized", issue = "18598")]

0 commit comments

Comments
 (0)