Skip to content

Fix typed integral Rust array repetition counts - #5991

Merged
dmitrii-f-t27 merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:codex/rust-repeat-counts
Oct 4, 2026
Merged

dmitrii-f-t27 merged 1 commit into
gHashTag:masterfrom
dmitrii-f-t27:codex/rust-repeat-counts

Conversation

@dmitrii-f-t27

Copy link
Copy Markdown
Contributor

Typed integral repetition counts such as [value; COUNT] with COUNT: u32 generated Rust with E0308, even though the array type position already converted its length to usize. Infer the complete count expression with the existing parser/type maps and qualify only a known non-usize integer width. Preserve grouping, literal/list/usize/unknown-width output and rejection of bool/float/comparison counts.

Closes #5986.

  • Actual Rust 1.96 tests: five passing tests cover four integral widths, grouped and zero lengths, literal/list/usize controls, five rejected non-integral counts and a type-correct source mutant rejected at runtime. The execution driver covers 260 values including u32::MAX. Baseline had six E0308 errors and one passing/two failing harness tests.
  • Native M1/M2 pass; full bootstrap M3 has 2817 passed, zero failed, two ignored across 121 targets. Full native corpus ratchet passes with the same 95 expected failures and unchanged cap126. The compiler retains its inherited build warnings.
  • Native hash audit covers all 804 existing referenced sealed specs. Six specs/15 aliases change only Rust; RAW output hashes match the actual seal path, with 17 whole-count qualifications and all other tokens/comments unchanged. No new standalone Rust diagnostic classes/counts. Native save without force and verification update only those aliases; coverage remains 1449/1325/124 and the ledger is unchanged. Their inherited Zig test reports remain honestly BLOCKED.
  • Additional compile-only tri-net preview with the same stricter lint wrapper improves 77/102 to 78/102, solely api_documenter, with zero regressions. These counts differ from earlier previews using module-specific allowances. This PR does not adopt a tri-net compiler PIN or claim runtime proof for those modules.

An initial unrestricted cast admitted bool/float lengths; actual negative controls caught this before publication. The final change converts declared integral expressions only. The source fixture, native regression tests, compiler digest, audited seals, human NOW evidence and a single appended task intent are included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust array repetition must convert named integral counts to usize

1 participant