Skip to content

fix(rust): a function type is a type alias, not a const's value - #3365

Merged
gHashTag merged 2 commits into
masterfrom
fn-type-is-a-type-alias
Sep 14, 2026
Merged

gHashTag merged 2 commits into
masterfrom
fn-type-is-a-type-alias

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closes #3364

master:  pub const Middleware: i32 = fn ( MiddlewareContext ) bool;
here:    pub type Middleware = fn(MiddlewareContext) -> bool;

The parser has no production for a function type — it swallows the whole text into one ExprIdentifier named "fn ( MiddlewareContext ) bool" — and the const emitter printed it as a value. C emits the same shape and Zig does not generate, so no neighbour answers this one; but nothing is being decided either, because a function type has exactly one Rust spelling and the current output is not an alternative to it.

Measured, two pinned binaries of distinct hashes over 650 specs: 352 OK both sides, zero regressions. +0. Exactly one spec changes output, server/http.t27, and it still fails — on expected expression, found \@`` underneath.

That underneath is the more useful finding. tri one-away reported this spec as carrying exactly one error; repairing it revealed the next. rustc abandons a file at the first parse error, so a sole uncoded diagnostic is a floor, not a total — the correction now folded into #3360 before it merges, which turns its headline from 50 into 24 exact and 26 lower bounds.

Narrow on purpose: = fn(...) also spells a closure with a body in two specs; those are values and are left alone.

@gHashTag
gHashTag enabled auto-merge (squash) September 6, 2026 06:19
@github-actions

github-actions Bot commented Sep 6, 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 6, 2026

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-06 06:20:05 UTC

Summary

Status Count
Total Open PRs 14
PRs with Failing Checks 10
PRs with All Checks Green 4
READY 3
FAILING 10
PENDING 0
NO CHECKS YET 0

These columns do not partition: 3 + 10 + 0 + 0 = 13, and there are 14 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=f503cc3e8477 != 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).

This was referenced Sep 6, 2026
This was referenced Sep 9, 2026
Conflicts were in FROZEN_HASH and in the server-http seals. compiler.rs
merged cleanly with #3621. Master's seals were taken and FROZEN_HASH
recomputed from the merged source. With the merged binary,
check_seal_currency --stale-specs lists exactly one spec out of 945,
specs/server/http.t27. It was resealed and the check now lists 0.

The NOW entry is re-dated because the required freshness gate accepts only
yesterday..tomorrow UTC. The 650-spec rustc measurement in the PR predates
this update and was not repeated.

cargo test --release: 3573 passed, 0 failed. The census gate passes.

Refs #3364

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@gHashTag
gHashTag merged commit 92559d1 into master Sep 14, 2026
33 of 34 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

📓 NotebookLM Notebook linked to this PR

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

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-09-14 13:29:27 UTC

Summary

Status Count
Total Open PRs 15
PRs with Failing Checks 8
PRs with All Checks Green 7
READY 5
FAILING 8
PENDING 0
NO CHECKS YET 0

These columns do not partition: 5 + 8 + 0 + 0 = 13, and there are 15 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=7cab95c431bc != 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).

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 function type is not a value: const X = fn(A) R emits const X: i32 = fn ( A ) R

1 participant