{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreifiugosc7qzqagcoxqocpjvcqsntvfjwrqm42iz7bibo2fjf7moja",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mgwwqa3pm4m2"
},
"path": "/t/optional-features-are-part-of-the-crate-the-project-should-say-so/24069#post_19",
"publishedAt": "2026-03-12T23:32:40.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "I prefer to use `cargo hack test --feature-powerset` (with `--include-features` and `--exclude-features` as needed, e.g. for platform-specific or platform-incompatible features).\n\nI also overrode `rust-analyzer.check.overrideCommand` in `.vscode/settings.json` to a program that makes (and caches) several calls to `cargo hack clippy --feature-powerset --depth 1`. The result is that all errors, from any tested `cfg` combination, are overlaid. However, it's not enough for go-to-def or type hints... `cfg`-d out code still gets grayed out as normal.\n\nI think the ideal would be for rust-analyzer to support overlaying results from multiple sets of `cfg`s, targets, and so on without having to use third-party workarounds. (I fear the cost in RAM usage might be high, but then again, my `check.overrideCommand` does a pretty bad job of caching stuff and still works fine.)",
"title": "Optional features are part of the crate — the project should say so"
}