Skip to content

Commit b14d4df

Browse files
gHashTaggHashTag
andauthored
chore: annotate host/mod.rs re-export facade (#969 dead-code) (#1114)
The crate-root pub use lines in host/mod.rs re-export the host-driver API for external consumers; the binary's own non-test build does not consume them, so they emit 42 unused_imports warnings. Add a single module-scoped cfg_attr(not(test), allow(unused_imports)) documenting the intentional facade, without removing any export. Non-test warnings drop 726 -> 685. Closes #1111 Co-authored-by: gHashTag <admin@t27.ai>
1 parent 9c5dae6 commit b14d4df

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

bootstrap/src/host/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,15 @@
1313
// write `use t27c::host::{BitnetDriver, MockMmio, DriverError};`.
1414
// ============================================================================
1515

16+
// Variant L (#969 dead-code audit, re-export-hub layer). This module is an
17+
// intentional public API facade: every `pub use` below re-exports a host-driver
18+
// type for external consumers. The binary crate's own non-test build does not
19+
// consume them, so each line emits an `unused_imports` warning (42 in total).
20+
// They are deliberate public surface, not dead code -- a single module-scoped
21+
// allow documents that without removing any export or touching the API. Scoped
22+
// to `not(test)` so the test build still flags genuinely unused test imports.
23+
#![cfg_attr(not(test), allow(unused_imports))]
24+
1625
pub mod addrmap;
1726
pub mod bitmask;
1827
pub mod bitstream;

docs/NOW.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Last updated: 2026-06-14
44

5+
## deadcode-annotate-host-mod -- #969 next layer: annotate the host/mod.rs re-export facade (Closes #1111)
6+
7+
- **WHERE**: `bootstrap/src/host/mod.rs` (one module-scoped inner attribute + explanatory comment, after the header comment, before the `pub mod` declarations).
8+
- **WHAT**: next conservative slice of the #969 dead-code audit, the re-export-hub layer. After #1105 the non-test build still emits ~726 warnings; 42 of them are `unused_imports` on the crate-root `pub use` lines in `host/mod.rs`. These lines re-export the host-driver API for external consumers (`use t27c::host::{BitnetDriver, MockMmio, DriverError};`), but the binary crate's own non-test build does not consume them, so each emits an unused-import warning. This module is an intentional public API facade, not dead code -- a single module-scoped `#![cfg_attr(not(test), allow(unused_imports))]` documents that and silences the 42 warnings WITHOUT removing any export or touching the API. It is scoped to `not(test)` so the test build still flags genuinely unused test imports.
9+
- **Why** mass-suppression hides real defects (see #1097, where building dead code surfaced 7 latent errors), so the audit stays conservative and per-surface: this pass annotates only the one re-export facade, leaving everything else for explicit follow-up. Non-test build warnings drop 726 -> 685 (the 42 facade re-exports); full suite stays green with 0 regressions; `not(test)` scope preserves test-build flagging. L6 gf16 SSOT untouched; catalog stays 83; no gen/ edits; ASCII-only added lines; no quality claim added. Closes #1111.
10+
- **Anchor**: phi^2 + phi^-2 = 3
11+
12+
513
## compiler-negative-tests-ext -- extend the parser negative-tests gate beyond casts (Closes #1110)
614

715
- **WHERE**: `bootstrap/src/compiler.rs` (`#[cfg(test)] mod tests_compiler_rejects`: new helper `try_emit` + five tests appended after `accepts_valid_cast_as_control`).

0 commit comments

Comments
 (0)