Background
Test support code must be placed in scoped and cfg-guarded modules so that only the code needed by a given test compilation is included, rather than relying on broad lint suppressions.
Raised during review of PR #116 by @leynos.
Required changes
tests/support/mod.rs (around lines 362–385)
Replace the two forbidden #[allow(...)] attributes in the routines_symbol_refs function with narrowly scoped #[expect(..., reason = "...")] attributes:
-
Change #[allow(dead_code)] above routines_symbol_refs to:
#[expect(dead_code, reason = "compile-time symbol reference used for API stability checks in tests")]
-
Change #[allow(clippy::type_complexity)] immediately before the complex const type assertion for routines::make_minimal_engine to:
#[expect(clippy::type_complexity, reason = "explicit compile-time type assertion for RoutineEngine/Receiver tuple in tests")]
Keep attributes local to the function. Ensure attribute names and reasons reference the symbols involved (routines_symbol_refs, routines::create_workspace, routines::make_minimal_engine, routines::make_routine, routines::make_test_incoming_message) so the intent is clear.
tests/support/routines.rs (lines 7–8 and 27–43)
-
Remove the crate-level #![allow(dead_code)] attribute (lines 7–8).
-
Add #[expect(dead_code, reason = "used only in e2e_traces")] directly on the specific items (functions/structs/consts) that are only referenced by e2e_traces. If an item cannot be identified immediately, apply the expect attribute to the smallest enclosing module or individual item rather than a crate-wide attribute.
-
Replace every remaining #[allow(dead_code)] occurrence (lines 27–43 and elsewhere) with a narrowly scoped:
#[expect(dead_code, reason = "<meaningful justification for the specific symbol>")]
Specifically update:
- The struct and
impl for SystemEventSpec (symbols: SystemEventSpec, new)
- Every other occurrence at the noted lines
Each attribute must be converted individually with a meaningful reason text for that symbol.
Acceptance criteria
- No
#[allow(dead_code)] or #[allow(clippy::...)] attributes remain in tests/support/mod.rs or tests/support/routines.rs.
- All replacements use
#[expect(..., reason = "...")] with a non-empty, symbol-specific reason string.
- The
#![allow(dead_code)] crate-level attribute is removed from tests/support/routines.rs.
- Lint suppression is scoped to the smallest applicable item, not a whole module or crate.
References
Background
Test support code must be placed in scoped and
cfg-guarded modules so that only the code needed by a given test compilation is included, rather than relying on broad lint suppressions.Raised during review of PR #116 by @leynos.
Required changes
tests/support/mod.rs(around lines 362–385)Replace the two forbidden
#[allow(...)]attributes in theroutines_symbol_refsfunction with narrowly scoped#[expect(..., reason = "...")]attributes:Change
#[allow(dead_code)]aboveroutines_symbol_refsto:#[expect(dead_code, reason = "compile-time symbol reference used for API stability checks in tests")]Change
#[allow(clippy::type_complexity)]immediately before the complexconsttype assertion forroutines::make_minimal_engineto:#[expect(clippy::type_complexity, reason = "explicit compile-time type assertion for RoutineEngine/Receiver tuple in tests")]Keep attributes local to the function. Ensure attribute names and reasons reference the symbols involved (
routines_symbol_refs,routines::create_workspace,routines::make_minimal_engine,routines::make_routine,routines::make_test_incoming_message) so the intent is clear.tests/support/routines.rs(lines 7–8 and 27–43)Remove the crate-level
#![allow(dead_code)]attribute (lines 7–8).Add
#[expect(dead_code, reason = "used only in e2e_traces")]directly on the specific items (functions/structs/consts) that are only referenced bye2e_traces. If an item cannot be identified immediately, apply theexpectattribute to the smallest enclosing module or individual item rather than a crate-wide attribute.Replace every remaining
#[allow(dead_code)]occurrence (lines 27–43 and elsewhere) with a narrowly scoped:#[expect(dead_code, reason = "<meaningful justification for the specific symbol>")]Specifically update:
implforSystemEventSpec(symbols:SystemEventSpec,new)Each attribute must be converted individually with a meaningful
reasontext for that symbol.Acceptance criteria
#[allow(dead_code)]or#[allow(clippy::...)]attributes remain intests/support/mod.rsortests/support/routines.rs.#[expect(..., reason = "...")]with a non-empty, symbol-specific reason string.#![allow(dead_code)]crate-level attribute is removed fromtests/support/routines.rs.References