microsoft / windows-rs

Rust for Windows
https://kennykerr.ca/rust-getting-started/
Apache License 2.0
10.36k stars 486 forks source link

Re-enable `unexpected_cfgs` #3050

Closed ChrisDenton closed 4 months ago

ChrisDenton commented 4 months ago

This is an attempt to re-enable unexpected_cfgs using the new unexpected_cfgs config in Cargo.toml. This avoids the need for a build script while still checking for typos in global cfgs.

ChrisDenton commented 4 months ago

Hm, looks like it isn't enough to just add it to the workspace lint table.

kennykerr commented 4 months ago

Well that's less bad. 🥲 Thanks Chris!

kennykerr commented 4 months ago

Hmm, noticing a bunch of warnings in local builds now.

warning: D:\git\windows-rs\crates\tests\calling_convention\Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg
warning: D:\git\windows-rs\crates\tests\debugger_visualizer\Cargo.toml: unused manifest key: lints.rust.unexpected_cfgs.check-cfg
warning: D:\git\windows-rs\Cargo.toml: unused manifest key: workspace.lints.rust.unexpected_cfgs.check-cfg

Looks like this is only on stable and goes away on nightly. Is that expected?

ChrisDenton commented 4 months ago

Oh. Hm. Looks like this is expected on stable. A fix to silence the warnings was backported to beta but not current stable. So it will be an issue until the next release.