Any chance Mutex::new() will become a const fn?

I'm curious if anyone knows whether Mutex::new() might become a const fn someday. It would be really lovely to be able to creates someday a static mutex without requiring a OnceCell (or lazy_static).

The standard library mutex allocates, so it cannot be a const fn without changing its implemenation. The one in parking_lot can be used instead.


It also performs some syscalls.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.