Each cargo::rustc-cfg should have an accompanying unconditionalcargo::rustc-check-cfg directive to avoid warnings like this: unexpected cfg condition name: has_foo.
We probably want something like fn emit_check(cfg: &str) to pair with the current emit. Then each AutoCfg::emit_* method should call emit_check unconditionally, while their probe still guards their emit.
Maybe a combined helper is appropriate too, like fn emit_checked(cfg: &str, cond: bool).
Ref: https://blog.rust-lang.org/2024/05/06/check-cfg.html
We probably want something like
fn emit_check(cfg: &str)
to pair with the currentemit
. Then eachAutoCfg::emit_*
method should callemit_check
unconditionally, while their probe still guards theiremit
.Maybe a combined helper is appropriate too, like
fn emit_checked(cfg: &str, cond: bool)
.