Skip to content

Commit

Permalink
Make Send + Sync bounds conditional (fixes #8)
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Nov 15, 2020
1 parent f5a2838 commit 92f40b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -377,8 +377,8 @@ where
_marker: marker::PhantomData<S>,
}

unsafe impl<T, S> Send for Unordered<T, S> where S: Sentinel {}
unsafe impl<T, S> Sync for Unordered<T, S> where S: Sentinel {}
unsafe impl<T, S> Send for Unordered<T, S> where S: Send + Sentinel {}
unsafe impl<T, S> Sync for Unordered<T, S> where S: Sync + Sentinel {}

impl<T, S> Unpin for Unordered<T, S> where S: Sentinel {}

Expand Down
4 changes: 2 additions & 2 deletions src/pin_slab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ pub struct PinSlab<T> {
next: usize,
}

unsafe impl<T> Send for PinSlab<T> {}
unsafe impl<T> Sync for PinSlab<T> {}
unsafe impl<T> Send for PinSlab<T> where T: Send {}
unsafe impl<T> Sync for PinSlab<T> where T: Sync {}

enum Entry<T> {
// Each slot is pre-allocated with entries of `None`.
Expand Down

0 comments on commit 92f40b4

Please # to comment.