-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(maitake-sync): add proper ScopedRawMutex
bound to wait_map::Wait
#515
Conversation
This seems to also be a thing for other types which specifically use the DefaultMutex default type, like the pub struct Lock<'a, T: ?Sized, L: ScopedRawMutex = DefaultMutex> { .. }
impl<'a, T> Future for Lock<'a, T> {..} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops! Thanks for fixing this!
We should probably add some tests that actually construct each synchronization primitive with an overridden ScopedRawMutex
type and check that all the expected trait impls are present, to prevent against future regressions with this sort of thing. I don't think it's worth holding up merging this fix for such tests, but I'll open an issue because I think it's worth doing.
Opened #516 for adding tests to ensure expected |
…dRawMutex` This commit fixes the trait bounds on the `mutex::Lock` type's `Future` implementation so that it's present when used with an overridden `ScopedRawMutex`, as well as the default `DefaultMutex`. Thanks to @peterkrull for reporting this issue in [this comment][1]! As noted in #516, I've also added tests for this, which wouldn't have compiled prior to this change. [1]: #515 (comment)
#517 fixes this for the |
…dRawMutex` This commit fixes the trait bounds on the `mutex::Lock` type's `Future` implementation so that it's present when used with an overridden `ScopedRawMutex`, as well as the default `DefaultMutex`. Thanks to @peterkrull for reporting this issue in [this comment][1]! As noted in #516, I've also added tests for this, which wouldn't have compiled prior to this change. [1]: #515 (comment)
…edRawMutex` (#517) This commit fixes the trait bounds on the `mutex::Lock` type's `Future` implementation so that it's present when used with an overridden `ScopedRawMutex`, as well as the default `DefaultMutex`. Thanks to @peterkrull for reporting this issue in [this comment][1]! As noted in #516, I've also added tests for this, which wouldn't have compiled prior to this change. [1]: #515 (comment)
I was unable to await the
Wait
when using a mutex defined in themutex
crate because a trait bound was not met. The current trait impl is not general enough.