decisions DECIDED

38. A suppression is scoped to an item and carries a reason, or it does not ship (milestone 41 (dead code: triage the suppressions))

Decided 2026-07-30, after triaging every allow(dead_code) / allow(unused) in the tree. This extends §35's disposition rule from scanner alerts to compiler warnings, which is where the same failure was already happening and nobody was counting.

The rule

A dead-code suppression is an item attribute (#[allow(...)]), never an inner attribute (#![allow(...)]), and it says which configuration has no caller. script/lint enforces the first half; the second half is a review expectation, and the phrasing that satisfies it is a cfg predicate rather than prose. Prefer, in order:

  1. Delete the code. Nothing calls it, git remembers it, and a reader who trusts the comments should not have to find out the hard way that a function is decorative.
  2. #[cfg_attr(<the configuration with no caller>, allow(dead_code))]. not(test) when the tests are the callers; feature = "bench" when a boot mode compiles the caller out; target_arch = "riscv64" when the item is one ISA's. The attribute then makes a checkable claim: if the caller disappears from the configuration that had one, the gate says so.
  3. A bare #[allow(dead_code)] with a written reason, for the cases where nothing calls it in any configuration and it stays on purpose: an arch-contract stub, a diagnostic that is off by default. Rare, and the reason is the whole justification.

Why an inner attribute is different in kind

An item allow is a decision about one item. An inner attribute is a decision about every item the module will ever contain, including the ones written after it, by someone who never saw the comment. That is not a suppression, it is a policy, and it decays the moment the module grows.

The measured cost was not hypothetical. Six files carried module-wide #![allow(dead_code)] over 5,831 lines, including sched.rs (3,166) and arch/aarch64/mmu.rs (1,275), and main.rs carried #![cfg_attr(target_arch = "riscv64", allow(dead_code))], which blindfolded the entire kernel crate on one of two supported architectures. script/lint runs clippy with -D warnings and reported success across all of it. Same class as the conflict markers that survived a full gate run and §27's four-times-corrected record: the tooling said fine because nothing was looking.

What the un-blindfolding actually found, which is the part worth keeping

Mostly not dead code. That is the honest result and it is why the ratchet matters more than the cleanup: the value was never in the deletions, it was in learning that the claims were unchecked.

Rejected