This code will compile on Unix platforms, but not on Windows platforms (X is not in scope).
Is there a Cargo command that will check, for all possible configurations/feature flags/etc, that they are valid? I don't necessarily want to build for Windows, but I want to make sure that anyone building for Windows won't have this sort of issue. This is especially key because it's pretty easy to mess up like this, especially in larger codebases.
Other than running cargo check --target={TARGET} multiple times for several targets, I'm not aware of any local tools that do this. (Though this is probably very similar to/the same as what I'd do in CI for this)
Of course, there may be something for this that I'm unaware of.
Here is an extension for Cargo that will run the given subcommand (check, test, etc.) with all combinations of features. However, this doesn't cover built-in cfg items like unix, windows, target_arch = "...", etc. For those you probably want to cargo test on each target you care about in CI.