Skip to content

Conversation

@jmwample
Copy link
Owner

@jmwample jmwample commented May 7, 2024

No description provided.

@jmwample jmwample merged commit bcf19d0 into main May 7, 2024
@jmwample jmwample deleted the compile-fixes branch May 7, 2024 21:36
@Urgau
Copy link

Urgau commented May 24, 2024

Heads up, with the release of rust-lang/cargo#13913 (in nightly-2024-05-19), there is no longer any need for the kind of workarounds employed in this PR. Cargo has now gain the ability to declare --check-cfg args directly inside the [lints] table with [lints.rust.unexpected_cfgs.check-cfg]1:

Cargo.toml:

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(foo)'] }

Note that the diagnostic output of the lint has been updated to suggest the [lints] approach first. You can use it to guide you through the --check-cfg arguments that may need to be added.

Footnotes

  1. take effect on Rust 1.80 (current nightly), is ignored on Rust 1.79 (current beta), and produce an unused warning below

@jmwample
Copy link
Owner Author

Thank you! This is great to know for future updates. For now I think the workaround is still required since I am trying to target msrv <=1.70.

@Urgau
Copy link

Urgau commented May 24, 2024

I'm pretty sure that doesn't matter since the warning is only reported for local-development, not when used as a dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants