Skip to content

fix(rust): [T] lost its element type, and "string" was not an alias (+5, 0 regressions) - #3215

Merged
gHashTag merged 2 commits into
masterfrom
typefix-clean
Sep 5, 2026
Merged

gHashTag merged 2 commits into
masterfrom
typefix-clean

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Two spellings share the shape [...] and the element type sits on opposite sides of
the bracket. t27_type_to_rust read only one of them.

} else {
    // Zig-style `[N]T`: size in brackets, element after `]`.
    let after = &t[end + 1..];
    format!("Vec<{}>", Self::t27_type_to_rust(after))
}

For [N]T the element follows the bracket and this is right. For t27's own [T] —
the spelling the corpus actually uses, as in proof_steps: [ProofStep] — the element
is inside the bracket and after is the empty string. 52 specs received Vec<>,
which rustc cannot parse, so everything behind it in the file was invisible to any
first-error histogram.

A second, adjacent miss: the Rust mapper knew "str" and not "string", so 34 specs
using the long spelling received the bare word string as a Rust type.

The target was set by sibling backends, not inferred

  • the C emitter already reads [ProofStep] correctly — the same field comes out as ProofStep* proof_steps;, and [string] as const char** args;
  • the Zig mapper already spells the alias "str" | "string" => "[]const u8" at compiler.rs:8322

Both fixes are the same shape as the one in #3208: a rule that exists in one
emitter and never travelled to its sibling.

Measured, 650 corpus specs, by name

rustc accepts, before either fix 224
after #3208 (serde) alone 237
after these two, on top 242
gain from this change +5
regressions 0
specs emitting Vec<> or pub f: , 52 → 22

The 22 that remain are the pub f: , form — an empty field type, a different cause —
and are not touched here.

The gap between "52 specs stopped emitting a degenerate type" and "+5 accepted" is the
same distinction #3208 recorded: a first-error count is not an unblocking count.

Closes #3213

…+5, 0 regressions)

Two spellings share the shape `[...]` and put the element type on opposite sides
of the bracket. Zig-style `[N]T` has the size in the brackets and the element
after them; t27's own `[T]` -- the spelling the corpus uses, as in
`proof_steps: [ProofStep]` -- has the element in the brackets and nothing after.
`t27_type_to_rust` read only the tail, so 52 specs received `Vec<>`, which rustc
cannot parse, hiding everything behind it from any first-error histogram.

Adjacent: the Rust mapper knew "str" and not "string", so 34 specs using the long
spelling received the bare word `string` as a Rust type.

Neither fix required a judgement about meaning. The C emitter already writes
`ProofStep* proof_steps;` and `const char** args;` for these fields, and the Zig
mapper already spells the alias `"str" | "string"` at compiler.rs:8322. Same shape
as #3208: a rule that exists in one emitter and never travelled to its sibling.

Measured by name over all 650 corpus specs: rustc accepts 237 -> 242, +5, zero
regressions; specs emitting a degenerate type 52 -> 22. The 22 left are the
`pub f: ,` form, a different cause.

Seal and 40 drifted seals move in the same commit; only gen_hash_rust and
sealed_at change.

Closes #3213

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 00:21:11 UTC

Summary

Status Count
Total Open PRs 14
PRs with Failing Checks 11
PRs with All Checks Green 3
READY 1
FAILING 11
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=7f1f58f33681 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 00:32:20 UTC

Summary

Status Count
Total Open PRs 14
PRs with Failing Checks 11
PRs with All Checks Green 3
READY 0
FAILING 11
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=7f1f58f33681 != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag merged commit a8450a6 into master Sep 5, 2026
30 checks passed
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

This notebook contains session context, decisions, and artifacts for this work.

@gHashTag
gHashTag deleted the typefix-clean branch October 26, 2026 07:25
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.

[T] loses its element type: the bracket spelling t27 actually uses gave 52 specs Vec<>

1 participant