[go: up one dir, main page]

emit_possibility

Function emit_possibility 

Source
pub fn emit_possibility(cfg: &str)
Expand description

Indicates to rustc that a config flag should not generate an unexpected_cfgs warning

This looks like cargo:rustc-check-cfg=cfg(VAR)

As of rust 1.80, the compiler does automatic checking of cfgs at compile time. All custom configuration flags must be known to rustc, or they will generate a warning. This is done automatically when calling the builtin emit methods on AutoCfg, but not when calling autocfg::emit directly.

Versions before rust 1.80 will simply ignore this directive.

This function indicates to the compiler that the config flag never has a value. If this is not desired, see [the blog post][check-cfg].