Skip to content

fix(rust): undefined is a declaration, not a value - #3341

Merged
gHashTag merged 1 commit into
masterfrom
undefined-is-a-declaration
Sep 5, 2026
Merged

fix(rust): undefined is a declaration, not a value#3341
gHashTag merged 1 commit into
masterfrom
undefined-is-a-declaration

Conversation

@gHashTag

@gHashTag gHashTag commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Closes #3340

cannot find value \undefined`was the largest single name in the corpus's first-error census — **14 of 21** in its class — and every one of them sat in the same position:let mut x: T = undefined;`.

The emitter already writes the right thing three lines up, for the no-initialiser case. So the repair is to treat undefined as no initialiser, not to invent a value.

Why not Default::default(). That was tried and withdrawn (#3223) because [usize; 256] has no Default. The blocker was the mapping, not the defect. Deferred initialisation needs no bound, and it is the exact semantics: Zig says "uninitialised", Rust says "declared, assign before use". github/auth.t27 now reports E0381: partially assigned binding — a real defect surfaced where a default would have swallowed it.

Two call sites, not one. gen_fn carries its own copy of the local-emission logic. The first attempt patched gen_rust_stmt alone and changed no output at all — the fix did not travel inside a single emitter, one scope smaller than the emitter-to-emitter gaps this corpus is full of. There is now one predicate, is_undefined_init, and two callers.

Measured, two pinned binaries of distinct hashes over 651 specs: 336 OK both sides, 245 FAIL, 69 NOGEN — zero regressions. The column does not move.

What moves: the first rustc error changed on 13 of 14. The fourteenth is vsa/similarity_search.t27, a pub static mut xs: [T; N] = undefined; — named as untouched before the measurement, because a static cannot be uninitialised in Rust. The predicted exception is the only one.

@gHashTag
gHashTag enabled auto-merge (squash) September 5, 2026 20:07
@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 20:07:16 UTC

Summary

Status Count
Total Open PRs 16
PRs with Failing Checks 8
PRs with All Checks Green 8
READY 7
FAILING 8
PENDING 0

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=60f03d78aeca != 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 ff4d5f8 into master Sep 5, 2026
30 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.

undefined reaches rustc as an identifier: 14 of 21 in the cannot-find-value class

1 participant