Repository navigation
Conversation
An `allow(dead_code)` stays in place after the code it covers becomes used, and then hides dead code added later. `expect(dead_code)` warns once the code is used, so the attribute cannot outlive its reason. Convert all `allow(dead_code)` and `allow(unused)` attributes to `expect(dead_code)`. Remove attributes whose code is used, and scope those that only apply to non-test or non-debug builds with `cfg_attr`. Derive `PartialEq` on `CodecConcreteType` unconditionally, since its field is read through `Debug` in error messages. Keep `allow` with an explicit opt-out comment where `expect` cannot work: a macro whose expansions differ in what they use, and `MigrationAction`, whose used variants change with each catalog migration. Add a `bin/lint` check that rejects `allow(dead_code)` and `allow(unused)`, and document the rule in the style guide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
antiguru
added this pull request to stack #39529
October 4, 2026 18:18
This was referenced Oct 4, 2026
This branch has not been deployed
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.
An
allow(dead_code)stays in place after the code it covers becomes used, and then hides dead code added later.expect(dead_code)warns once the code is used, so the attribute cannot outlive its reason. This converts allallow(dead_code)andallow(unused)attributes and adds abin/lintcheck that rejects new ones.Stale attributes are removed. Attributes on code that is dead only outside tests or without debug assertions are scoped with
cfg_attr.CodecConcreteTypenow derivesPartialEqunconditionally, since its field is read throughDebugin error messages. Two sites keepallowbehind an explicit// allow(allow-dead-code)opt-out: a macro whose expansions differ in what they use, andMigrationAction, whose used variants change with each catalog migration.The rule is documented in
doc/developer/style.md. Supersedes the fork PR #39525.Posted by Claude Code.
🤖 Generated with Claude Code