Repository navigation
D108/D114 sweep (#2262 item 4): a .len() is an isize; the cast moves to the narrowing or goes away - #2346
Merged
Conversation
added 3 commits
October 11, 2026 08:59
…t moves to the narrowing or goes away 4414 `.len() as i32` sites stripped in src/; the seed and the installed compiler then named every real narrowing (an isize into an i32 field, index id or parameter) and the cast went back there: at the declaration when two or more uses narrow or the local is a let, at the use when one does. 738 casts remain in src/, each at a genuine i32 demand. Both compilers check src/main.w clean.
…same rule as src/ 925 sites stripped; the narrowings the seed and the installed compiler named got their cast back at the declaration or the use. The migrated corpora are untouched (D112). Every touched tools and std file checks clean; build.w checks clean under the pinned seed and the installed compiler.
…ng only, no convention change; WITH_ABI_VERSION unchanged)
.len() is an isize; the cast moves to the narrowing or goes away
…(MirValidationTests, foundation/Arena, InternPool, Source) get the same rule The battery's one red: these four are not reachable from src/main.w, so the check loop never saw their narrowings. Casts restored at the i32 demands; out/bootstrap/bin/with-stage1 test test/internals: 70 files ok.
Contributor
Author
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.
Implements item 4 of #2262 (items 1–3 landed with #2327).
.len() as i32sites stripped across src, lib/std (not the migrated corpora, D112), rt, tools, build/ and build.w. 803 casts remain, each at a genuine i32 demand (an i32 field, id, parameter or index width the D114 audit kept).letor two or more uses narrow, at the use when one does.docs/with-abi.sha256re-recorded: the sweep touchedsrc/TypeLayout.wwith spelling only; WITH_ABI_VERSION unchanged.src/main check src/main.wandwith check src/main.wclean, seed-driven:devgreen, seed-driven:gategreen (survey: all targets green, 884 s).Stacked on #2345. Draft until the stack's battery is green.