chore: make dead code a compile error + drop dead index_types module#277
Merged
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… index_types Adds a [workspace.lints] table denying dead_code and unused_imports, with each member crate opting in via [lints] workspace = true. Dead code is now a hard `cargo build`/`cargo test` error, not just a clippy -D warnings CI warning, so an unused fn/field/variant/import cannot rot silently. Also removes tests/sqlx/src/index_types.rs (and its lib.rs mod + IndexTypes re-export). The module was a typo-prevention constants scaffold added with the SQLx test migration (2025-10-27, a252cff) but never adopted — all six constants had zero references since creation. It is the kind of dead code the new lint is meant to stop, but rustc's dead_code lint exempts unused *pub* items in a lib crate (it assumes a sibling/downstream crate may use them), and eql_tests is a lib consumed by its integration tests, so the pub module slipped through. Removed by hand; the lint guards the private-dead-code case going forward. Verified: full workspace + every integration test target compiles clean under the new deny policy; eql-scalars/eql-codegen/eql-tests-macros test suites green.
cf2fd4c to
741bc98
Compare
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.
Summary
Makes dead code a hard compile error workspace-wide, and removes a long-dead module that prompted it.
[workspace.lints]denyingdead_code+unused_imports, with each member crate opting in via[lints] workspace = true. Dead code now fails plaincargo build/cargo test— not only theclippy -D warningsCI job — so an unused fn/field/variant/import can't rot silently.tests/sqlx/src/index_types.rs(+ itslib.rsmodandIndexTypesre-export). It was a typo-prevention constants scaffold added with the SQLx test migration (2025-10-27,a252cff) but never adopted — all six constants (HMAC,BLAKE3,ORE64,ORE_CLLW_U64_8,ORE_CLLW_VAR_8,ORE_BLOCK_U64_8_256) had zero references since the commit that created them. The tests use the literal strings ("hm","ob", …) inline instead.Why remove it by hand instead of letting the lint catch it?
rustc's
dead_codelint exempts unusedpubitems in a library crate — it assumes a sibling/downstream crate may consume them.eql_testsis a lib whose integration tests (tests/*.rs) are separate crates that link it, so itspubharness items are always "potentially used", and the unusedpubmodule slipped through. Verified: building with-D dead_codedid not flag it. The lint guards the private dead-code case going forward; thepubexception is handled by the corollary rule now documented in the workspaceCargo.toml: don't mark a test-support itempubunless an integration test actually consumes it.Test Plan
cargo build --workspaceclean under the new deny policy (no dead-code/unused violations).cargo test --no-run) — removingindex_typesbroke nothing; no latent dead code to fix.eql-scalars/eql-codegen/eql-tests-macrostest suites green.index_types/IndexTypes(0 references, confirmed across full git history).Notes
eql_v3. Trivial potential overlap intests/sqlx/Cargo.toml(this adds a[lints]table; feat(v3): N-block ORE comparator + ordered numeric & timestamptz #276 adds therust_decimaldep) — easily resolved.eql_v3, notmain.🤖 Generated with Claude Code