Run Feature Gated Validation

RUST-RUN-FEATURE-GATED-VALIDATION

Summary

Exercise the feature combinations touched by a Rust change so gated code, docs, and integrations actually build. Choose representative combinations when exhaustive feature matrices would be too expensive.

Rule

Run feature-gated tests and docs when changing feature-gated Rust integrations.

Why

Feature-gated code can compile, document, and behave differently from the default build. A change to an optional integration is not validated by default-feature tests alone.

Cargo features are additive across a resolved dependency graph, and docs.rs often builds with a selected feature set. That means feature-gated API, examples, and docs need direct validation; a default build can miss missing imports, broken docs, or incompatible optional dependency versions.

Helps

  • Helps optional integrations stay buildable, documented, and behaviorally covered.

Limits

Do not run every expensive feature matrix on every small edit. Choose the feature combinations that cover the changed surface and keep slower combinations scheduled or manual. Always include the feature combination that users are told to enable in docs or examples.

Agent Instruction

Validate the feature combinations affected by a Rust change, including docs for features that change
public items.

Mechanisms

Supported by cargo test --all-features, targeted --features checks, docs builds with selected features, and CI matrices for important combinations.

References