-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Make {Mutex, Notify, OnceCell, RwLock, Semaphore}::const_new
always available
#5885
Conversation
Why not make
|
I see #5877 tries to bump msrv to 1.63 and it will eliminate the use of Or merging this PR first then talk about bumping msrv later, I'm fine with either. |
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.
Personally, I would prefer to raise the MSRV, but we will have to hear from other maintainers on that.
We can raise the MSRV to 1.63 and remove the trace call from |
Somehow rebasing this against main caused CI to fail:
I don't think this is caused by this PR. |
If we are raising the MSRV, then it should happen in its own separate PR. |
This comment was marked as outdated.
This comment was marked as outdated.
I've opened #5887 to bump tokio MSRV to 1.63 |
{Mutex, Notify, OnceCell, RwLock, Semaphore}::const_new
available on rust-version >= 1.63{Mutex, Notify, OnceCell, RwLock, Semaphore}::const_new
always available on rust-version >= 1.63
{Mutex, Notify, OnceCell, RwLock, Semaphore}::const_new
always available on rust-version >= 1.63{Mutex, Notify, OnceCell, RwLock, Semaphore}::const_new
always available
There are some tests using this that currently only run when the |
5d805a1
to
66542d0
Compare
Thanks, I've enabled these tests by default and also remove use of cfg |
I think it's better to do this in a separate PR and it will require quite some duplication since rust doesn't permit |
… available Since MSRV is bumped to 1.63, `Mutex::new` is now usable in const context. Also use `assert!` in const function to ensure correctness instead of silently truncating the value and remove cfg `tokio_no_const_mutex_new`. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
Test |
Thanks. I've restarted the failed CI jobs. |
I've removed the |
I've removed those checks from the list of required checks. |
Thanks! Now CI is green. |
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.
Thanks.
Motivation
MSRV is bumped to 1.63 in #5887 , now
Mutex::new
is usable in const context, so these functions should now be always available.Solution
This patch makes these function always available.
Also use
assert!
in const function to ensure correctness instead of silently truncating the value and remove use of cfgtokio_no_const_mutex_new
.This PR might resolve #4623