docs(lints): cross-reference allocation_policy.md from Cargo.toml + clippy.toml (Phase 6 follow-up, refs #193)#286
Merged
Conversation
…lippy.toml (Phase 6 follow-up, refs #193) Phase 6 \u00a711.9 follow-up: parity with the Phase-5e `panic_policy.md` cross-reference precedent. `Cargo.toml` and `clippy.toml` already point at `docs/architecture/code-quality/panic_policy.md` (PR #278) so a contributor running `grep panic_policy Cargo.toml` immediately finds the contract for the deny-level `unwrap_used` / `expect_used` / `panic` lints. The same shape was missing for the allocation contract \u2014 a grep for `allocation_policy Cargo.toml` returned nothing before this change, defeating the discoverability the `docs/architecture/code-quality/allocation_policy.md` doc was designed to provide. This is a doc-comments-only change. The `[workspace.lints]` block remains byte-identical at the TOML-value level: only trailing comments and the doc-block above `# \u2500\u2500\u2500\u2500\u2500 Memory & allocation \u2500\u2500\u2500\u2500\u2500` gained content. What changed ------------ `Cargo.toml` (5 edits): - **Doc block above `# \u2500\u2500\u2500\u2500\u2500 Memory & allocation \u2500\u2500\u2500\u2500\u2500` (line 460):** 4-line cross-reference paragraph mirroring the panic-policy block at line 322-326. Points at `allocation_policy.md`, the five-category taxonomy, and the `clone_alloc_audit.sh` script. - **Per-lint trailing comments** added to seven existing deny-level clone-family lints (lines 353, 354, 372, 376, 377, 378, 379, 466, 467, 468) referencing the corresponding `allocation_policy.md` section: - `clone_on_ref_ptr` \u2192 \u00a73.1 (category \u03b1) - `redundant_clone` \u2192 \u00a73.4 (category \u03b4) - `inefficient_to_string` \u2192 \u00a72 - `str_to_string` \u2192 \u00a72 - `implicit_clone` \u2192 \u00a72 - `cloned_instead_of_copied` \u2192 \u00a72 - `map_clone` \u2192 \u00a72 - `assigning_clones` \u2192 \u00a72 - `rc_buffer` \u2192 \u00a73.1 (\u03b1) - `rc_mutex` \u2192 \u00a73.1 (\u03b1) `clippy.toml` (1 edit): - Extended the existing "Test code relaxations" comment block (which already references `panic_policy.md`) with a parallel paragraph referencing `allocation_policy.md` for the clone- and allocation- family lints. Lists the eight family lints explicitly so future contributors can grep on either lint name and find the contract. Verification ------------ - `just lint-pre-push` \u2705 (86s): every gate green \u2014 fmt-check, file-size, gates-drift, hooks-drift, workflow-drift, fast-drift, manifest-drift, commit-subjects, vet, vet-audit-discipline, machete, typos, reuse, cargo-check, lint-ci, lint-prod, lint-tests, rustdoc, doc-tests, tests, smoke, deny, lint-ci-windows. - `cargo metadata` parses cleanly (Cargo.toml structure unchanged at the TOML value level; only comments added). - `cargo clippy --workspace --all-targets` emits zero diagnostics (lint values unchanged). - Test count unchanged: 1,833 / 1,833 passing. Behavior & contracts -------------------- - Zero functional change. The `[workspace.lints]` deny-set is byte-identical at the TOML-value level. - Public API unchanged. - Doc-comment-only change. Strict-lint posture ------------------- No suppression hacks introduced. No new `#[allow]` / `#[expect]` anywhere. All edits are TOML doc comments. Phase 6 closeout reference -------------------------- This closes the only remaining Phase-6 follow-up item recorded in `phase_6_final_report.md` \u00a711.9 #1. Plan \u00a711.5 (Strict-lint posture) gets a status update from "Pending parity follow-up" to "Complete" after this PR lands. refs #193
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 6 §11.9 follow-up: parity with the Phase-5e
panic_policy.mdcross-reference precedent (PR #278).The gap this closes
Cargo.tomlandclippy.tomlalready point atpanic_policy.mdso a contributor runninggrep panic_policy Cargo.tomlimmediately finds the contract for the deny-levelunwrap_used/expect_used/paniclints.The same shape was missing for the allocation contract — a grep for
allocation_policy Cargo.tomlreturned nothing before this change, defeating the discoverability thatdocs/architecture/code-quality/allocation_policy.md(PR #285) was designed to provide.What this changes
Doc-comment-only edits. The
[workspace.lints]block remains byte-identical at the TOML-value level — only trailing comments and the doc-block above# ───── Memory & allocation ─────gained content.Cargo.toml(4 edits, 11 lines net)New 5-line doc block above
# ───── Memory & allocation ─────(line 460) mirroring the panic-policy block at line 322-326. Points atallocation_policy.md, the five-category taxonomy (α/β/γ/δ/ε), and thescripts/dev/clone_alloc_audit.shscript.Per-lint trailing comments added to the relevant deny-level clone-family lints with section refs back into
allocation_policy.md:clone_on_ref_ptrredundant_cloneinefficient_to_stringstr_to_stringimplicit_clonecloned_instead_of_copiedmap_cloneassigning_clonesrc_bufferrc_mutexclippy.toml(1 edit)Extended the existing "Test code relaxations" comment block (which already references
panic_policy.md) with a parallel paragraph referencingallocation_policy.mdfor the eight clone- and allocation-family lints. Lists each family lint explicitly so future contributors can grep on either lint name and find the contract.Verification
just lint-pre-push✅ (86s) — every gate green: fmt-check, file-size, gates-drift, hooks-drift, workflow-drift, fast-drift, manifest-drift, commit-subjects, vet, vet-audit-discipline, machete, typos, reuse, cargo-check, lint-ci, lint-prod, lint-tests, rustdoc, doc-tests, tests, smoke, deny, lint-ci-windows.cargo metadataparses cleanly — TOML structure unchanged at value level.cargo clippy --workspace --all-targetsemits zero diagnostics (lint values unchanged).Behavior & contracts
[workspace.lints]deny-set is byte-identical at the TOML value level.Strict-lint posture
No suppression hacks. No new
#[allow]/#[expect]. All edits are TOML doc comments.Phase 6 closeout reference
Closes the only remaining Phase-6 follow-up item recorded in
phase_6_final_report.md§11.9 #1 (local-only, gitignored under/docs/dev/). Plan §11.5 status moves from "Pending parity follow-up" to "Complete" after this PR lands.refs #193