Add attribute stacking style to policy.md
What changed, and why it matters
This commit only adds a coding-style rule to the project's documentation. It tells developers to prefer stacking multiple #[cfg] attributes instead of combining them with #[cfg(all(...))]. No code behavior changed, and there is no security impact.
No action needed; this is a documentation-only style policy change with no security relevance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff appends a new style guideline to docs/policy.md recommending stacked #[cfg] attributes over #[cfg(all(…))] for simple conjunctions. It is purely documentation; no Rust source, build script, dependency, or API was modified.
Changed components
docs/policy.mdInspect captured patch +11 / −0
diff --git a/docs/policy.md b/docs/policy.md
index 83c27a35..86c66606 100644
--- a/docs/policy.md
+++ b/docs/policy.md
@@ -349,6 +349,17 @@ See [Errors](#errors) section.
compatible. These configuration conditionals are set at build time in `bitcoin/build.rs`. New
version attributes may be added as needed.
+- Use stacked attributes over `#[cfg(all(...))]` when a simple conjunction applies to the same item.
+
+ Good:
+ ```rust
+ #[cfg(feature = "alloc")]
+ #[cfg(feature = "hex")]
+ ```
+ Bad:
+ ```rust
+ #[cfg(all(feature = "alloc", feature = "hex"))]
+ ```
## BIP References
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.