Skip to content

Conversation

samueltardieu
Copy link
Member

@samueltardieu samueltardieu commented May 6, 2025

When a non_std_lazy_statics warning is generated about an item type which can be replaced by a standard library one, ensure that the lint happens on the item HIR node so that it can be expected.

changelog: [non_std_lazy_statics]: generate the warning onto the right node

Fixes #14729

Note that this doesn't change anything on lints generated for the lazy_static::lazy_static macro because the expect attribute cannot be applied to a macro.

When a `non_std_lazy_statics` warning is generated about an item type which
can be replaced by a standard library one, ensure that the lint happens on
the item HIR node so that it can be expected.
@rustbot
Copy link
Collaborator

rustbot commented May 6, 2025

r? @Manishearth

rustbot has assigned @Manishearth.
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 May 6, 2025
Copy link
Contributor

@Jarcho Jarcho left a comment

Choose a reason for hiding this comment

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

Thank you.

@Jarcho Jarcho added this pull request to the merge queue May 14, 2025
Merged via the queue into rust-lang:master with commit 373df52 May 14, 2025
11 of 13 checks passed
@samueltardieu samueltardieu deleted the issue14729 branch May 14, 2025 09:15
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.

#[expect(clippy::non_std_lazy_statics)] does not correctly suppress lint on types
4 participants