Skip to content

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

Open
gHashTag wants to merge 1 commit into
masterfrom
fn-type-is-a-type-alias
Open

fix(rust): a function type is a type alias, not a const's value#3365
gHashTag wants to merge 1 commit 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).

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