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

add new lint non_std_lazy_statics #13770

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

Conversation

pitaj
Copy link
Contributor

@pitaj pitaj commented Dec 1, 2024

fixes #12895

detects usage of once_cell::sync::Lazy and lazy_static!, recommending usage of std::sync::LazyLock instead

Many thanks to @J-ZhengLi for putting in most of the work in #12968

changelog: new lint non_std_lazy_statics

@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2024

r? @llogiq

rustbot has assigned @llogiq.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 1, 2024
@pitaj pitaj changed the title add new lint [non_std_lazy_statics] add new lint non_std_lazy_statics Dec 1, 2024
detect usage of `once_cell::sync::Lazy` and `lazy_static!`,
recommending usage of `std::sync::LazyLock` instead
@bors
Copy link
Contributor

bors commented Dec 5, 2024

☔ The latest upstream changes (presumably a5e46a6) made this pull request unmergeable. Please resolve the merge conflicts.

@llogiq
Copy link
Contributor

llogiq commented Dec 8, 2024

Thank you. This looks like a solid improvement, it just needs a rebase.

@llogiq
Copy link
Contributor

llogiq commented Dec 29, 2024

@pitaj ping? Can you rebase?

@pitaj
Copy link
Contributor Author

pitaj commented Jan 1, 2025

@llogiq sorry about the late response. Based on zulip discussion, I need to make a couple of changes:

  • change lint group to pedantic
  • add a check to avoid linting if other types from once_cell are used

@samueltardieu
Copy link
Contributor

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties labels Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Recommend std::sync::LazyLock over other lazy static options
6 participants