Repository navigation
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
Conversation
…22 widening casts, never-rebound vars, empty literals and iterate-the-list loops (#3061)
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.
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:
x as i64(and tenas u32) where the context already widens (§4.2.6);varnever rebound:let;HashMap.new()/List.new()under a written type:[:]/[](D93);for i in 0..xs.len():that only indexesxs: 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).