Skip to content

Commit 44a9927

Browse files
committed
chore: make dead code a compile error (workspace [lints]) + drop dead 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, 47d1c21) 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.
1 parent 46ace0b commit 44a9927

7 files changed

Lines changed: 18 additions & 23 deletions

File tree

Cargo.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ members = [
2323
"tests/sqlx",
2424
]
2525
default-members = ["tests/sqlx"]
26+
27+
# Dead code is a hard error. Note: rustc exempts unused `pub` items in a lib, so
28+
# don't `pub` a test-support item unless an integration test consumes it.
29+
[workspace.lints.rust]
30+
dead_code = "deny"
31+
unused_imports = "deny"

crates/eql-codegen/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,6 @@ path = "src/main.rs"
1616
[lib]
1717
name = "eql_codegen"
1818
path = "src/lib.rs"
19+
20+
[lints]
21+
workspace = true

crates/eql-scalars/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ description = "Scalar/term catalog for EQL encrypted-domain codegen (std-only, n
88
# generator (eql-codegen) compiles in ~1-2s and never drags serde/toml onto the
99
# SQL build's critical path. Do not add deps here.
1010
[dependencies]
11+
12+
[lints]
13+
workspace = true

crates/eql-tests-macros/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,6 @@ syn = { version = "2", features = ["full"] }
1212
quote = "1"
1313
proc-macro2 = "1"
1414
eql-scalars = { path = "../eql-scalars" }
15+
16+
[lints]
17+
workspace = true

tests/sqlx/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ eql-tests-macros = { path = "../../crates/eql-tests-macros" }
2323
[dev-dependencies]
2424
# None needed - tests live in this crate
2525

26+
[lints]
27+
workspace = true
28+
2629
[features]
2730
default = []
2831
# Opt-in to slow benchmark / regression / scale tests. Without this feature

tests/sqlx/src/index_types.rs

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/sqlx/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ use sqlx::PgPool;
77
pub mod assertions;
88
pub mod fixtures;
99
pub mod helpers;
10-
pub mod index_types;
1110
pub mod matrix;
1211
pub mod scalar_domains;
1312
#[macro_use]
@@ -37,7 +36,6 @@ pub use helpers::{
3736
read_pg_stat_statements, reset_pg_stat_statements, ExplainStats, PgStatEntry,
3837
PLACEHOLDER_PAYLOAD,
3938
};
40-
pub use index_types as IndexTypes;
4139
pub use scalar_domains::{
4240
assert_null, assert_raises, assert_scalar_plaintexts, blocker_msg, commute_op,
4341
fetch_fixture_payload, sql_string_literal, ScalarDomainSpec, ScalarType, Variant,

0 commit comments

Comments
 (0)