Skip to content

The compiler's private functions do not restate their return types (closes #3061) - #3620

Merged
ehartford merged 4 commits into
mainfrom
sweep-fn-ret
Nov 25, 2026
Merged

ehartford merged 4 commits into
mainfrom
sweep-fn-ret

Conversation

@ehartford

Copy link
Copy Markdown
Contributor

Closes #3061: the last of its eight rewrites (an inferable return type) is run over src/.

The tool. with fix-ceremony --apply removed every candidate and, when the program then stopped checking, put all of them back; over src/ that was 1,207 of 1,207. It now finds the ones the program needs, round by round, from the compile it already does: a function that infers another type than it declared, and a function an error names (a caller of a function with no type is refused at the call, D43). Only those go back.

The sweep. About 1,200 restated return types removed from private functions in 110 files of src/; 6 kept, each reported with its reason. pub signatures keep theirs. The result checks under the installed compiler and the pinned seed. The ABI source hash is re-recorded: FnAbi.with and TypeLayout.with changed by removed return types only, no convention.

Cleaned in the same file. src/CeremonyFix.with held four index loops over parallel lists and two index comprehensions. They are gone: the per-edit facts are in records, the put-back marks are keys, the edit order is sort_by. The census's index-loop count for src falls.

One line of std. Enumerated.next restated its index's type; the census measured it for the first time because the compiler now instantiates it.

Test. behav_3061_fix_ceremony_cli: two functions that call each other keep their types, and a function beside them that needs none loses its own (it used to be all three kept).

Evidence. Battery GREEN on e67a1c531, the same tree as this branch's top (git diff between them is empty); :release-checks green there too. The base of the stack, #3619, is merged.

Eric Hartford added 4 commits November 25, 2026 13:05
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.

with fix-ceremony: a Sema-driven rewriter that removes ceremony the compiler can prove unnecessary

1 participant