Skip to content

Commit

Permalink
fix(maitake-sync): add proper ScopedRawMutex bound to `wait_map::Wa…
Browse files Browse the repository at this point in the history
…it` (#515)

I was unable to await the `Wait` when using a mutex defined in the
`mutex` crate because a trait bound was not met. The current trait impl
is not general enough.
  • Loading branch information
peterkrull authored Feb 6, 2025
1 parent bf8d93b commit 509a8b7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion maitake-sync/src/wait_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,11 @@ unsafe impl<K: PartialEq, V> Linked<list::Links<Waiter<K, V>>> for Waiter<K, V>

// === impl Wait ===

impl<K: PartialEq, V> Future for Wait<'_, K, V> {
impl<K, V, Lock> Future for Wait<'_, K, V, Lock>
where
K: PartialEq,
Lock: ScopedRawMutex,
{
type Output = WaitResult<V>;

fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
Expand Down

0 comments on commit 509a8b7

Please sign in to comment.