Repository navigation
fix(rust): the type parameter was in the AST, dropped in three places (+13) - #3235
Merged
Merged
Conversation
… (+13)
The parser keeps the list -- `ArrayView(T)` arrives as `params: ["T: "]` -- and
this emitter dropped it while keeping every use, so 19 specs generated a struct
whose fields name a type nothing declares.
The class did not close until all three positions were repaired, and each alone
was worth almost nothing:
pub struct Name<T> on the declaration 275 -> 275 +0
<T> on free functions that use it 275 -> 276 +1
Name(T) -> Name<T> at every type USE 275 -> 288 +13
Zero regressions at every step, measured by spec name. The declaration alone
changes nothing because the module-level free functions still name `T`; both
together change almost nothing because the uses keep the call-style spelling, and
rustc says so precisely -- "parenthesized type parameters may only be used with a
`Fn` trait" -- in 12 of the 19.
No sibling backend had the answer here: C has no generics and the Zig emitter
drops the parameter too. The mapping is forced rather than chosen. Names come from
the AST, and a whole-word matcher keeps a struct named `Trit` from being matched by
a parameter named `T`.
Also corrects my own predictor. The stub-share rule of #3219 is an upper bound that
applies only once every site is repaired: predicted +12..+19 for the first two
steps and measured +1, then predicted +6..+12 for the third and measured +13.
Seal and 38 drifted seals move in the same commit.
Closes #3234
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
gHashTag
enabled auto-merge (squash)
September 5, 2026 02:41
This was referenced Sep 5, 2026
Merged
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
1 similar comment
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
Contributor
PR DashboardGenerated at: 2026-09-05 02:55:02 UTC
Summary
Seal Status
|
Contributor
|
📓 NotebookLM Notebook linked to this PR
This notebook contains session context, decisions, and artifacts for this work. |
Contributor
PR DashboardGenerated at: 2026-09-05 03:00:06 UTC
Summary
Seal Status
|
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.
The parser keeps the type-parameter list —
ArrayView(T)arrives asparams: ["T: "]— and the Rust emitter dropped it while keeping every use of theparameter. 19 specs generated a struct whose fields name a type nothing declares.
The class needed all three positions, and each alone was worth nothing
pub struct Name<T>on the declaration<T>on free functions that use itName(T)→Name<T>at every type useZero regressions at every step.
The declaration alone changes nothing because the module-level free functions still
name
T; both together change almost nothing because the uses keep thecall-style spelling, and rustc says so precisely — "parenthesized type parameters may
only be used with a
Fntrait" in 12 of the 19.No sibling had the answer this time
C has no generics and writes
struct ArrayView; the Zig emitter drops the parametertoo. The mapping is still forced rather than chosen: the spec declares a type
parameter and
<T>is how Rust spells one. The parameter names come from the AST,not from a guess about single capital letters — and the whole-word matcher exists so a
struct named
Tritcannot be matched by a parameter namedT.Two predictions, both off, and why
Predicted +12 to +19 for the first two steps because the class is 100%
stub-bodied (94 of 94 functions). Measured +1. Then predicted +6 to +12 for
the third and measured +13.
The stub-share predictor from #3219 is an upper bound that only applies once every
site of the class is repaired — it says what the class could yield, never what a
partial repair will. A partial repair of a class yields roughly nothing, which is the
older lesson: a defect class is not closed until every position it occupies is
enumerated.
Closes #3234