#[expect(clippy::non_std_lazy_statics)]
does not correctly suppress lint on types
#14729
Labels
C-bug
Category: Clippy is not doing the correct thing
Uh oh!
There was an error while loading. Please reload this page.
Summary
When using a
Lazy
type from another crate (e.g.lazy_regex
), thenon_std_lazy_statics
lint is triggered, but fails to be recognised when it isexpect
ed.expect
ing the lint seems to work fine when using e.g.lazy_static::lazy_static!
, but when the offending item is in the type position it doesn't like it.Clippy version:
clippy 0.1.88 (4824c2bb74 2025-05-02)
Reproducer
Take the following code:
Running
cargo clippy
gives the following output, which makes sense:Adding
#[expect(clippy::non_std_lazy_statics)]
:New code
And
cargo clippy
now says:So, the
#[expect(...)]
is not suppressing the lint correctly.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: