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

Make TryLock::new const fn #2

Merged
merged 6 commits into from
Dec 7, 2023
Merged

Conversation

yvt
Copy link
Contributor

@yvt yvt commented Jul 10, 2020

Enables the use of TryLock::new in a constant context.

Requires Rust 1.31.0 or later and discontinues the support for the older versions. (I'd like to hear your opinion on this - Do you still intend to support Rust 1.21? Or can we drop the support after a major version bump?)

@chrysn
Copy link

chrysn commented Feb 9, 2021

@seanmonstar, could you have a look at this? Apart from the constness, it looks like a TryLock would be very useful for static items.

@Chris--B Chris--B mentioned this pull request Nov 14, 2021
@Chris--B
Copy link

Pinging here, because I ran into the exact issue and would love to use a crates.io version of this instead of a GitHub fork. Using this in static items effectively requires TryLock::new be const, and moving the MSRV up from very old to pretty old seems like an easy ask imo.

@Finomnis
Copy link

Finomnis commented Dec 4, 2023

@seanmonstar Any thoughts on this? Two years later now, bumping the min version to 1.31 really doesn't seem like much of an issue any more :)
I'm also in favor of removing the deprecated function and releasing a 1.0 version, since this crate seems quite battle tested. (>90 Mil downloads on crates.io)

Copy link
Owner

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

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

1.21 to 1.31 is a pretty reasonable change at this point. It's still several years ago.

@seanmonstar seanmonstar merged commit 1fe343d into seanmonstar:master Dec 7, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants