The rustc-cfg crate uses the rustc --target <triple> --print cfg command, which works for determining toolchain/target information but it will not work for determining Cargo-based compiler configurations, such as features enabled or disabled via the RUSTFLAGS environment variable. The cargo rustc -- --print cfg and optionally the cargo rustc --target <triple> -- --print cfg commands should be used instead. The rustc-cfg crate does not appear to support the cargo rustc command. I am in the process of creating a new cargo-rustc-cfg crate inspired by the rustc-cfg crate that does use the cargo rustc commands. The rustc-cfg crate should then be replaced with this new one.
The rustc-cfg crate uses the
rustc --target <triple> --print cfgcommand, which works for determining toolchain/target information but it will not work for determining Cargo-based compiler configurations, such as features enabled or disabled via theRUSTFLAGSenvironment variable. Thecargo rustc -- --print cfgand optionally thecargo rustc --target <triple> -- --print cfgcommands should be used instead. The rustc-cfg crate does not appear to support thecargo rustccommand. I am in the process of creating a newcargo-rustc-cfgcrate inspired by the rustc-cfg crate that does use thecargo rustccommands. The rustc-cfg crate should then be replaced with this new one.