Skip to content
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

maitake-sync: test sync type Future impls (etc) with overridden ScopedRawMutex #516

Closed
hawkw opened this issue Feb 6, 2025 · 0 comments · Fixed by #518
Closed

maitake-sync: test sync type Future impls (etc) with overridden ScopedRawMutex #516

hawkw opened this issue Feb 6, 2025 · 0 comments · Fixed by #518
Assignees
Labels
crate/maitake Related to the `maitake` crate

Comments

@hawkw
Copy link
Owner

hawkw commented Feb 6, 2025

See #515, where wait_map's Wait future's Future impl only exists with DefaultMutex.

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.

Originally posted by @hawkw in #515 (review)

@hawkw hawkw self-assigned this Feb 6, 2025
@hawkw hawkw added the crate/maitake Related to the `maitake` crate label Feb 6, 2025
hawkw added a commit that referenced this issue Feb 6, 2025
…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)
hawkw added a commit that referenced this issue Feb 6, 2025
…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)
hawkw added a commit that referenced this issue Feb 6, 2025
Depends on #517

As described in #516, this commit adds tests ensuring that `Future`
impls are always present for sync primitive future types when using
user-provided `ScopedRawMutex`/`RawMutex` impls. This should help
protect against future regressions.

Fixes #516
hawkw added a commit that referenced this issue Feb 6, 2025
…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)
@hawkw hawkw closed this as completed in #518 Feb 6, 2025
@hawkw hawkw closed this as completed in dd00208 Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crate/maitake Related to the `maitake` crate
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant