Repository navigation
Conversation
…ct, enum or test twice (Refs #10421, #5980) gen-js keeps the first of two consts and gen-c reads the last, so check now fails with an error instead of staying silent (const, var) or warning (fn, struct, enum, test). A bench keeps its warning: two corpus specs still carry one. Fixtures: refuse/ per kind, accept/sibling_blocks as the negative control. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 18, 2026
Contributor
This was referenced Oct 18, 2026
Closed
…he refused fixtures (Refs #10421) spec-guards' duplicate-declarations self-check recognises a duplicate by the sentence "every backend rejects a redeclaration"; the new error said something else, so the planted-duplicate and duplicated-test cases read 0. The sentence is also true now that check refuses the input, so the error uses it again. emit-bitexact requires every tracked .t27 to generate with some backend. The ten spec fixtures that a duplicated top-level name now makes a typecheck error (six new ones, four in core_selfhost/refuse) are ledgered in specs_generate_baseline.txt as "not a debt", the way the other typecheck refuse fixtures already are. compiler.rs: one string changed, net 0 lines. FROZEN_HASH re-sealed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…efs #10421) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
PR DashboardGenerated at: 2026-10-18 12:11:53 UTC
Summary
Seal Status
|
This was referenced Oct 18, 2026
Merged
This was referenced Oct 18, 2026
Merged
Merged
This was referenced Oct 18, 2026
Merged
Open
Merged
This branch has not been deployed
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.
Summary
t27c checknow fails with an error when a module declares one top-levelconst,var,fn,struct,enumortestname more than once in one namespace. Before, a duplicateconst/varpassed silently and a duplicatefngot only a warning, while the backends disagreed on which copy wins (gen-jskeeps the first value,gen-creads the last,gen-verilogemits two parameters,test-reportis blocked by zig).Closes #10421. Refs #5980 (the self-hosted core already refuses this with
E_NAME; this brings the Rust front end to the same rule).What changed
bootstrap/src/compiler.rs:duplicate_top_level_declsnow also collects module-levelconst/var(onlyast.children, so a localconstinside a body stays scope). Intypecheck_asta same-namespace duplicate is counted as an error. A duplicatedbenchkeeps its warning; the "type and function share a name" and "lowered collision" warnings are unchanged.bootstrap/stage0/FROZEN_HASH: re-sealed for thecompiler.rschange.bootstrap/tests/duplicate_declarations.rs: assertions moved from "warning" to "error"; the obsolete "finding is a warning and does not change the exit code" test is removed; the clean fixture gained two sibling functions that each declare a localconst K(negative control).bootstrap/tests/fixtures/duplicate_toplevel/:refuse/has one fixture per kind (dup_const,dup_var,dup_fn,dup_struct,dup_test) plusdup_const_and_fn, the probe from the issue;accept/sibling_blocks.t27is the negative control.Lab run (Railway lab,
t27cbuilt from this branch)error: \` is declared N times -- a redeclaration is refused ...`.accept/sibling_blocks.t27: rc 0, no "is declared" line.Typecheck OK (0 errors, 1 warnings), rc 0 (the control showing the gap was real).gen-candgen-jsondup_const.t27now exit 1 too, since they run the same check.t27c checkover all 2262 specs on this branch: 0 refused, and the only "declared N times" warnings are the same two pre-existing duplicatedbenchnames (specs/igla/race/backend.t27,specs/igla/race/cordic_top.t27). Master baseline: 2261 specs, 0 refused, same 2 warnings. So 0 new failures.Out of scope
benchnames and promoting that case to an error.Foreign-language budget
This edits existing Rust. Net foreign lines:
compiler.rs+11/-1 (plus the seal line), the Rust test file +2/-14; lefthookforeign-budgetpassed without--no-verify. This PR is a draft and waits for the owner'sowner-approved-foreignlabel. Not to be merged before that.🤖 Generated with Claude Code