Configuration#
Everything about the matrix is configured from Cargo.toml metadata. The defaults — the powerset of a crate’s features, on the host target — need no configuration at all. You reach for configuration when you want to shape the matrix.
Read these in order the first time:
- Basics — where configuration lives.
- Shaping the feature matrix — the keys that add, remove, restrict, or pin combinations.
- The override model — the single precedence chain, patch operations, and
inherit. This is the mental model that ties everything together. - Per-target configuration — vary the matrix by target triple with
cfg(...)selectors. - Per-command configuration — vary the matrix by cargo subcommand.
- Flags in config — set
cargo fcflag defaults.
If you just want a working snippet for a specific situation, the Recipes section has copy-paste configurations for common scenarios.