Skip to content

The compiler's own source takes the rewrites the compiler proves: 1,230 widening casts, never-rebound vars, empty literals and iterate-the-list loops (#3061) - #3576

Merged
ehartford merged 1 commit into
mainfrom
src-ceremony-sweep
Nov 23, 2026
Merged

ehartford merged 1 commit into
mainfrom
src-ceremony-sweep

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Part of #3061: the src/ sweep the issue planned as its own PR.

with fix-ceremony --apply --check-with src/main src/main.with, twice (the second round took the 8 rewrites the first exposed). Every rewrite rests on a fact Sema recorded while checking the program; the tool re-checks the entry with the rewrites in, then has the pinned seed check it too, and puts back anything either refuses. Nothing was refused.

What changed, 53 files:

  • about a thousand x as i64 (and ten as u32) where the context already widens (§4.2.6);
  • var never rebound: let;
  • HashMap.new() / List.new() under a written type: [:] / [] (D93);
  • for i in 0..xs.len(): that only indexes xs: iterates the list.

After it the tool offers no further rewrite on the compiler. Both the installed compiler and the seed check the result with no warning.

One cosmetic leftover for the rewriter, not fixed here: a removed cast inside an argument can leave its inner parentheses (text.slice(i, (i + 6))).

Battery green (563 s); self-audit and :release-checks, fixpoint included, green (603 s).

…22 widening casts, never-rebound vars, empty literals and iterate-the-list loops (#3061)
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.

1 participant