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

Merged
merged 1 commit into from
Jan 25, 2025
Merged

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
@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
detect usage of `once_cell::sync::Lazy` and `lazy_static!`,
recommending usage of `std::sync::LazyLock` instead
@pitaj
Copy link
Contributor Author

pitaj commented Jan 24, 2025

@rustbot ready

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties and removed S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) labels Jan 24, 2025
@llogiq llogiq added this pull request to the merge queue Jan 25, 2025
@llogiq
Copy link
Contributor

llogiq commented Jan 25, 2025

Thank you!

Merged via the queue into rust-lang:master with commit 4825666 Jan 25, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

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