Manishearth / triomphe

Fork of std::sync::Arc with lots of utilities useful for FFI
Apache License 2.0
215 stars 43 forks source link

`UniqueArc` can support weaker bounds for `Send`/`Sync` #67

Closed steffahn closed 10 months ago

steffahn commented 1 year ago

It’s like a Box, so it can support Send/Sync implementations like a Box.

Currently, it’s

impl<T: ?Sized> Send for UniqueArc<T>
where
    T: Send + Sync,
impl<T: ?Sized> Sync for UniqueArc<T>
where
    T: Send + Sync,

but as far as I can tell, it should be entirely sound to have it instead be

impl<T: ?Sized> Send for UniqueArc<T>
where
    T: Send,
impl<T: ?Sized> Sync for UniqueArc<T>
where
    T: Sync,
Manishearth commented 1 year ago

Good catch, thanks!