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

Swap out lazy_static for once_cell #72

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

james7132
Copy link

Fixes #71. Another benefit is that accessing registry's next counter doesn't require an extra lazy check, only on the actual freelist.

@hawkw
Copy link
Owner

hawkw commented Jun 7, 2022

It looks like CI is stuck on this PR --- not totally sure what's going on there.

@james7132
Copy link
Author

Should we report this to GitHub? This seems like it's permanently stuck.

@hawkw
Copy link
Owner

hawkw commented Jun 9, 2022

Looks like that was my fault; I changed the CI configuration, and it should run correctly now.

@jplatte
Copy link

jplatte commented Sep 21, 2022

@james7132 are you still intending to finish this (fix the two CI failures)?

@james7132
Copy link
Author

Looks like once_cell uses the 2021 edition, which has a MSRV of 1.56. Is this acceptable to bump the MSRV of this crate? or should I instead pin an earlier one that is compatible with this crate's MSRV of 1.42?

@james7132
Copy link
Author

@hawkw ping about this question

@jplatte
Copy link

jplatte commented Feb 28, 2023

@james7132 maybe just update the PR to get it to go green, since this would be a trivial change? Then there's a chance no further back and forth is needed when Eliza finds some time for this again.

@james7132
Copy link
Author

With syn 2.0.0 coming out bumping it's MSRV to 1.56, there's likely a bunch of crates bumping their MSRVs soon. Went ahead and updated the MSRV, added a rust_version field to Cargo.toml, and updated the CI workflow.

@james7132
Copy link
Author

Also bumped the edition to 2021.

@james7132
Copy link
Author

Loom seems to dislike once_cell's Lazy implementation. It's apparently unsupported right now, see tokio-rs/loom#263.

@james7132
Copy link
Author

james7132 commented Apr 2, 2023

Seems like parts of once_cell have been stabilized into std: rust-lang/rust#105587.

@raftario
Copy link

Now that OnceLock is stable another possibility would be to use it instead but keep lazy_static as an optional feature for older compiler support

@Expyron
Copy link

Expyron commented Nov 17, 2023

Although you probably don't want to increase the MSRV that much for now, VecDeque::new() was made const in 1.68, so it'll be possible to remove lazy_static/once_cell usage altogether at some point.

@notgull
Copy link

notgull commented Nov 25, 2023

Any progress on this PR? I'm trying to purge lazy_static from my dependency tree.

@jplatte
Copy link

jplatte commented Nov 27, 2023

Now that OnceLock is stable another possibility would be to use it instead but keep lazy_static as an optional feature for older compiler support

This would be nice. Could be a default Cargo feature msrvXXXX that you can disable to get a lighter dependency tree at the expense of requiring a newer compiler.

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.

Migrate from lazy_static to once_cell
6 participants