fix(gen-zig): test and bench blocks may shadow module names and write module vars (owner exception, #5980) - #6596
Merged
Merged
Conversation
…e a module var Closes #6295 Zig refused a test block whose local const shadowed a module declaration ("local constant shadows declaration of 'HITS'"). Test and bench blocks now rename locals that shadow module names (_lv), write module vars in place, and bench blocks choose var or const from the assignment count. specs/compiler/zig_test_shadowing.t27 is the regression spec. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d tests-fail seals Refs #6295 Regenerated on the Railway t27c lab (tri seals drift --fix, sync-twins). Nine specs now compile but their own tests fail or hang; sealed with --force (failures recorded in the seal) and ledgered as tests-fail (#6560). check_seal_currency and check_seal_coverage pass on the lab. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
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.
Closes #6295
What
Zig refused a test or bench block whose local shadowed a module declaration ("local constant shadows declaration of 'HITS'"), and a write to a module
varinside a test came out as a freshconst. Test and bench blocks now:x->x_lv, the same scheme the fn bodies use);varin place instead of re-declaring it;varorconstfrom the assignment count.specs/compiler/zig_test_shadowing.t27is the regression spec: module vars HITS/READY, fns twice/hit, three tests (module_var_write, local_shadows_module_names, reassign_declared_local) and a bench. On master it is BLOCKED with the shadowing error; with this fix 3/3 pass.Owner exception
This PR edits hand-written Rust (
bootstrap/src/compiler.rs), which the only-t27 rule forbids. The owner approved it on 2026-10-05, relayed by the coordinator ("fix it and do not stop, do what is best"), with the labelowner-approved-foreign. The debt is #5980 (t27core self-host). The entry intools/policy/foreign-exceptions.txt(bootstrap/src/compiler.rs) landed with #6579, so this PR does not change that file. After the last gen-zig PR (#6533) lands, the owner should remove it.File classification
bootstrap/src/compiler.rsbootstrap/stage0/FROZEN_HASHspecs/compiler/zig_test_shadowing.t27.trinity/seals/*.json(about 75)tri seals drift --fix,t27c seal --save --force,tri seals sync-twins)tools/seal_baseline.txttests-failrowsdocs/now/2026-10-06-gen-zig-test-shadowing.mdLab numbers (t27c reference: gen-zig + zig test over specs/, Railway t27c lab)
Seals
Seals were regenerated on the lab. Nine specs now compile but fail their own tests. They were sealed with
--force, which records the failures in each seal'stestsobject, and their 15 seals (twins included) are ledgered astests-failintools/seal_baseline.txtwith #6560. On the lab,check_seal_currencypasses andcheck_seal_coveragereports OK (1454 seals, 1310 hold, 144 known-broken).CI notes
The same failures as master: test-ratchet (
the_dead_code_census_names_what_it_skippedandcorpus_classifier_matches_lean_completeness), spec-guards (ring-096-rustDRIFTED, #6553), duplicate-bodies, fpga-conformance, and build-and-test (cargo install wasm-objdump).🤖 Generated with Claude Code