You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cargo-rail: meilisearch PR revealed a bug in Meilisearch and in cargo-rail; fixing 'undeclard features detection' to avoid 'borrowed features' sneaking through. added 'auto-fix' undeclared features w/ warning for manual. This is a big win.
|`prune_dead_features`|`bool`|`true`| Remove features that are never enabled in the resolved dependency graph across all targets. Only prunes empty no-ops (`feature = []`). Features with actual dependencies are preserved. |
109
109
|`preserve_features`|`string[]`|`[]`| Features to preserve from dead feature pruning. Supports glob patterns (e.g., `"unstable-*"`, `"bench*"`). Use this to keep features intended for future use or external consumers. |
110
+
|`detect_undeclared_features`|`bool`|`true`| Detect crates that rely on Cargo's feature unification to "borrow" features from other workspace members. These crates will fail when built standalone after unification. Reports as warnings (or auto-fixes if `fix_undeclared_features` is enabled). |
111
+
|`fix_undeclared_features`|`bool`|`true`| Auto-fix undeclared feature dependencies by adding missing features to each crate's Cargo.toml. Produces a cleaner graph where standalone builds work correctly. Requires `detect_undeclared_features = true`. |
110
112
|`max_backups`|`usize`|`3`| Maximum number of backup archives to keep. Older backups are automatically cleaned up after successful operations. Set to `0` to disable backup creation entirely. |
111
113
112
114
**Example:**
@@ -119,6 +121,8 @@ detect_unused = true
119
121
remove_unused = true
120
122
prune_dead_features = true
121
123
preserve_features = ["future-api", "unstable-*"] # Keep these from pruning
124
+
detect_undeclared_features = true# Catch borrowed features
125
+
fix_undeclared_features = true# Auto-fix them (default)
0 commit comments