Add CI test that `#[cfg]` tags are from a defined set 2023-12-check-cfg-tags
authorMatt Corallo <git@bluematt.me>
Fri, 8 Dec 2023 23:05:37 +0000 (23:05 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 8 Dec 2023 23:07:14 +0000 (23:07 +0000)
commit75c0e06ce19e4c74465814f31e25d3288a25c18f
treeeb0d3f1a4bd774c8b00413153233f505b48cc464
parentec8e0fe4784b758338145e8179db12c735ecd9de
Add CI test that `#[cfg]` tags are from a defined set

Rust is fairly relaxed in checking the validity of arguments
passed to #[cfg]. While it should probably be more strict when
checking features, it cannot be strict when checking loose cfg
tags, because those can be anything and are simply passed to rustc
via unconstrained arguments.

Thus, we do it for rustc manually, but scanning all our source and
checking that all our cfg tags match a known cfg tag.

Fixes #2184
.github/workflows/build.yml
ci/check-cfg-flags.py [new file with mode: 0755]