With -C check-cfg stabilized in Cargo v1.80 and enabled by default (see rust-lang/cargo#13571), newly introduced cfgs will emit compile errors when used inside the crate.
The solution is to emit cargo:rustc-check-cfg=cfg(your_cfg) inside the build.rs to register the new cfgs, this will emit warnings in older versions of Rust because the feature is not stable, but at least it won't emit errors in Rust v1.80 (or currently nightly).
See the -C check-cfg and the accompanying rustc-check-cfg documentation.
With
-C check-cfgstabilized in Cargo v1.80 and enabled by default (see rust-lang/cargo#13571), newly introducedcfgs will emit compile errors when used inside the crate.The solution is to emit
cargo:rustc-check-cfg=cfg(your_cfg)inside thebuild.rsto register the newcfgs, this will emit warnings in older versions of Rust because the feature is not stable, but at least it won't emit errors in Rust v1.80 (or currently nightly).See the
-C check-cfgand the accompanyingrustc-check-cfgdocumentation.