Skip to content

futures-util: make Mutex::new() const #2956

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jstarks
Copy link

@jstarks jstarks commented May 31, 2025

This builds with the MSRV (1.68) and is convenient for creating static mutexes.

This does bind the implementation to never allocate in new in the future, but that seems like a desirable property anyway.

Note that this also requires updating slab to 0.4.7, which is the first version that supports const Slab::new().

This builds with the MSRV (1.68) and is convenient for creating `static`
mutexes.

This does bind the implementation to never allocate in `new` in the
future, but that seems like a desirable property anyway.

Note that this also requires updating slab to 0.4.7, which is the first
version that supports const `Slab::new()`.
@rustbot rustbot added A-lock Area: futures::lock S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 31, 2025
Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@taiki-e taiki-e added 0.3-backport: pending The maintainer accepted to backport this to the 0.3 branch, but backport has not been done yet. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.3-backport: pending The maintainer accepted to backport this to the 0.3 branch, but backport has not been done yet. A-lock Area: futures::lock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants