Skip to content

fix(rust): a dotted foreign type has no Rust spelling either (+23, 0 regressions) - #3220

Merged
gHashTag merged 1 commit into
masterfrom
dotted-foreign-type
Sep 5, 2026
Merged

gHashTag merged 1 commit into
masterfrom
dotted-foreign-type

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

param_type_to_c answers this in its very first arm:

// A dotted foreign type (`std.mem.Allocator`) has no C spelling at all.
// It reached the header as `std.mem.Allocator x;`, which is not C;
// `void*` is the honest lowering and what a hand-written binding uses.
if ty.contains('.') && !ty.starts_with('[') { return "void*".to_string(); }

t27_type_to_rust never got one, so the path arrived verbatim and rustc stopped at
the first dot — pub allocator: std.mem.Allocator, — and never read the rest of the
file. One field accounted for 15 of the 24 specs in the class; 34 corpus specs
declare it. Rust's void* is *mut (), and it needs no import.

Fourth instance this pass of one shape: a rule that exists in one emitter and never
travelled to its sibling — after #3208, #3213 and #3216.

Measured, 650 corpus specs, by name

rustc accepts, before 252
after 275
gain +23
regressions 0

Why my two previous predictions were both far too low

I predicted 0–2 for #3216 and got 10; I predicted 4–8 here and got 23. Both
under, and the reason is now measured rather than guessed.

A signature-level fix clears a whole file only when the file has nothing else wrong,
and that is exactly the case when its bodies are stubs. Measured over the specs
each fix unblocked:

fix unblocked / first-errors stub bodies among the gainers
serde (#3208) 13 / 84 = 15% —
pointer (#3216) 10 / 39 = 26% 44 of 44 = 100%
dotted (this) 23 / 24 = 96% 100 of 100 = 100%

So the predictor is not "how deep do errors queue" — it is what fraction of the
class's specs are stub-bodied
, because a signature fix cannot help a real body that
has further defects. Corpus-wide only 8% of functions are stubs, which is a different
population and does not bear on this.

Closes #3219

…regressions)

`param_type_to_c` opens with this arm -- a dotted foreign type has no C spelling,
and `void*` is "the honest lowering and what a hand-written binding uses".
`t27_type_to_rust` never got one, so the path arrived verbatim and rustc stopped
at the first dot, `pub allocator: std.mem.Allocator,`, without reading the rest of
the file. One field accounted for 15 of the 24 specs in the class; 34 corpus specs
declare it. Rust's `void*` is `*mut ()` and needs no import.

Measured by name over all 650 corpus specs: rustc accepts 252 -> 275, +23, zero
regressions.

Also records why two predictions this pass were both far too low (0-2 vs 10, 4-8
vs 23). A signature-level fix clears a file only when nothing else is wrong with
it, which is when its bodies are stubs: 44 of 44 stub functions among #3216's
gainers, 100 of 100 among these. The predictor is the class's stub-bodied share,
not the depth of the error queue. Corpus-wide stubs are 8%, a different
population.

Seal and 47 drifted seals move in the same commit.

Closes #3219

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag enabled auto-merge (squash) September 5, 2026 01:10
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-05 01:11:03 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)=9f4e7ae386ba != 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

📓 NotebookLM Notebook linked to this PR

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

@gHashTag
gHashTag merged commit 5ef9a22 into master Sep 5, 2026
30 checks passed
@gHashTag
gHashTag deleted the dotted-foreign-type branch October 26, 2026 05:47
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.

A dotted foreign type has no Rust spelling either: the arm param_type_to_c opens with

1 participant