Skip to content

fix(rust): escape a keyword used as an enum variant or a function name (+2) - #3348

Merged
gHashTag merged 3 commits into
masterfrom
keyword-names-escaped
Sep 6, 2026
Merged

fix(rust): escape a keyword used as an enum variant or a function name (+2)#3348
gHashTag merged 3 commits into
masterfrom
keyword-names-escaped

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Closes #3347

The Zig emitter escapes enum variant names and says why, in a comment one line above its own call to zig_ident. The rule did not travel to Rust — and it had never reached the function name itself either.

rust_ident already escaped struct fields, parameters, struct-literal fields and field access. Two positions were missing:

enum = 12,                              ->  r#enum = 12,
continue = 5,                           ->  r#continue = 5,
pub fn match<T>(variant: Variant<T>)    ->  pub fn r#match<T>(...)
pub fn await<T>(future: Future<T>)      ->  pub fn r#await<T>(...)

Measured: 336 → 338, zero regressions. tri/collections/variant.t27 and tri/net/async.t27 compile now. The two enum-variant specs still fail, on causes that changedexpected identifier, found keyword became in expressions, \_` can only be used on…andexpected expression, found `]`` — which is how the fix was confirmed there rather than assumed.

How it was found, and two corrections to the instrument that found it:

  • Censusing the first rustc error of all 245 failures together with the generated line. The pairing separated four classes hiding inside one error text.
  • rustc prints aborting due to N previous errors as an error line, so a naive count of distinct classes said no spec was one fix away. Excluding the summary line, 95 are.
  • "One error away" is a lower bound on the work, not an upper one: rustc stops early, so fixing the first error surfaces others it never reached. Both enum specs demonstrate exactly that.

@gHashTag
gHashTag enabled auto-merge (squash) September 6, 2026 02:45
@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 02:47:14 UTC

Summary

Status Count
Total Open PRs 18
PRs with Failing Checks 10
PRs with All Checks Green 8
READY 6
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=23d95a8968cc != 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 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 03:19:09 UTC

Summary

Status Count
Total Open PRs 17
PRs with Failing Checks 10
PRs with All Checks Green 7
READY 6
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=23d95a8968cc != 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 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 03:27:25 UTC

Summary

Status Count
Total Open PRs 17
PRs with Failing Checks 10
PRs with All Checks Green 7
READY 6
FAILING 10
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=8c144e6dfce9 != 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 90f8763 into master Sep 6, 2026
31 checks passed
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 Rust keyword as an enum variant or a function name reaches rustc bare

1 participant