Result: done
Pushed: local b56d3298396aa172be3d17a44905c4b88dbdf9cf
Tests: both programs ok at –both-settings (scratch project at target/b39b-p, which test_only_helper’s root() needs); clippy –all-targets -D warnings clean; lower-std fixpoint; sysroot:: 8 ok; nikaia-std –lib 239 ok; pre-push green; test_only_helper fails on HEAD’s lowered files (no cfg(test) marks); cache 295M, disk 5.3G free, no new entry over 100 MB
Deviation: b39’s reach rule (any substring of the name in another file, any word in its own) left crossing_of/ours/foreign/is_refused in threads.rs dead (clippy red: locals let foreign, ours[i] in maps.nika); a mention is now a call (name(, not after .), modules_call_starts; a test-only helper used as a function value elsewhere would fail the non-test build loudly
Found: defect, issue to file (ready): a function returning a view of a String parameter lowers with a &'static str result; probe: fn before(text: String, name: String) -> String { let mut previous = ""; for line in text.lines() { if line.contains(name) { return previous }; previous = line.trim() }; return "absent" } -> main.rs fn before(text: &str, name: &str) -> &'static str, nikaia run: “Lifetime may not live long enough” at the return. To build: result lifetime from the returned local’s provenance (a view of text), a tests/compiler program with the probe; also a stray file at repo root named “ork in the tree), 1 is a_trait_column_change_warns …” (another agent’s shell slip), not touched
Needs: none
Changelog: A private function of a tools file that only its test blocks call lowers under #[cfg(test)], so the moved tests’ helpers need no pub and leave no dead code
Files: crates/nikaia-std/src/tools/emit_function.nika crates/nikaia-std/src/tools/manifest.nika crates/nikaia-std/src/tools/modules.nika crates/nikaia-std/src/tools/threads.nika crates/nikaia-std/src/tools/touch.nika crates/nikaia-std/src/tools/ty.nika crates/nikaia-std/src/tools/lowered.rs crates/nikaia-std/src/tools/lowered/emit_function.rs crates/nikaia-std/src/tools/lowered/manifest.rs crates/nikaia-std/src/tools/lowered/modules.rs crates/nikaia-std/src/tools/lowered/threads.rs crates/nikaia-std/src/tools/lowered/touch.rs crates/nikaia-std/src/tools/lowered/ty.rs crates/nikaia/src/sysroot.rs tests/compiler/tests/test_only_helper_lowers_under_cfg_test.nika tests/compiler/tests/test_only_helper_lowers_under_cfg_test.stdout
Commit: Test-only helpers of a tools file lower under cfg(test)
Fixes: #1160
Attribution:
Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01GFeMqxRbtUMiGVyDMxsvEq