cargo-hack icon indicating copy to clipboard operation
cargo-hack copied to clipboard

Allow testing common `cfg` flags in the feature powerset

Open CAD97 opened this issue 2 years ago • 1 comments

Notably, cfg(debug_assertions) can be used to enable/disable code paths, and it might also be useful to test on profiles both with overflow-checks on and off.

CAD97 avatar Apr 01 '22 17:04 CAD97

  • User-defined cfgs are set by passing the --cfg flag to rustflags.
  • rustc/cargo built-in cfgs are set by profiles or specific flags. In most cases, they are not set by the --cfg flag (from the user's point of view).

Supporting the former is relatively easy, except that there is no stable way to handle config properly. (To handle it properly, we need to call cargo-config like rust-analyzer and cargo-llvm-cov do.) Supporting the latter is a bit more complicated because the cfg mapping is needed.

taiki-e avatar Jul 20 '22 03:07 taiki-e