Open larseggert opened 2 months ago
This is when running clippy or is this reproducible with cargo check
as well? Well, unfortunately, I don't think this is something we can fix on our side. Using and suggesting use of cfg(fuzzing)
follows a well established example and it would be the tools that use the --check-cfg
the way they do that are overzealous here (especially if they fail to provide mechanisms to modify the behaviour easily.)
I would report this issue against cargo (if the issue is reproducible with cargo check
.)
I assume this is related to this recent change: https://blog.rust-lang.org/2024/05/06/check-cfg.html
@kpcyrd Yes, it is. Sorry, I should have said so in the report.
With the release of rust-lang/cargo#13913 (in nightly-2024-05-19), Cargo has gain the ability to declare --check-cfg
args directly in the [lints]
table with [lints.rust.unexpected_cfgs.check-cfg]
[^1]:
Cargo.toml
:
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(fuzzing)'] }
I recommand directly suggesting it in the README.md, although the lint diagnostic should already suggest that.
[^1]: take effect on Rust 1.80 (current nightly), is ignored on Rust 1.79 (current beta), and produce an unused warning below
cargo 1.80.0-nightly (05364cb2f 2024-05-03) now throws the following clippy error: