Repository navigation
c_import facade over an omitted function (#2244); unsafe calls in generic templates (#2235); per-target C aliases (#2176); migrate rule tags for migrate_diff (#2230) - #2247
Merged
Conversation
added 2 commits
October 7, 2026 02:56
…lared-and-omitted name is a hard error (#2244) A `c facade` item over a function the translator omitted reported "is not a declaration in scope", hiding the reason; it now names the omission and its reason, as any other use of the name does (emit_ci_omitted_symbol_error). And the shape #2244 found — the translator recorded a body as omitted yet still declared the name, so the facade was accepted and the call trapped — is refused at the import: a name both declared by the translation and recorded as omitted is a hard error naming the function and the reason, never a stub.
… the declaration (#2235) Whether a call needs an unsafe context is a property of the spelling, not of T. A generic owner's method has no signature until an instantiation and its body check returned at `sig_idx < 0`, so a library whose generic impl called an `unsafe fn` bare passed `with check` until a consumer instantiated it (trie, sorted_vec, hash_index on #2208). The template body is now checked for that once, at its declaration: a free function named by an identifier (not shadowed by a parameter) and the owner's own method through `self.m(...)` resolve without T, through the generic-aware decl map; a call that depends on T still waits for the instantiation, and an `unsafe fn` template is its own context.
added 6 commits
October 7, 2026 03:28
`long` is 32 bits on Windows and wasm32, `char` is unsigned on AArch64 Linux and wasm, and `long double` has a With float only where it is 64 bits (AArch64 Darwin, Windows); c_import and the migrate preamble emitted the arm64 macOS table for every target. One helper (ci_c_type_aliases) now derives the table from the parsed target — the Windows selection or a named C model's triple, else the active target — and a declaration that needs an unrepresentable `long double` is omitted with that reason instead of aliased to f64. A cross target hands clang its triple, so the C side parses as that target too (c_import still refuses a cross target before parsing; the hook is the right half of that refusal). The migrated corpora name an arm64 Darwin model and keep their bytes.
…n's body is evidence for its own parameters (#2230, D107) The migration differential's second half: the migrator records each rewrite rule it applies — D101's `{0}` and memset-to-zero rewrites to `T.zeroed()`, D107's nullable-by-evidence parameters and the NULL-compare folds they license — as `rule<TAB>function<TAB>detail`, one line per distinct site, written as `rules.tsv` beside a directory migration's output (never promoted). tools/migrate_diff.w names the rules under each function whose lowering differs, and says when none was recorded: a difference that is not a migrator rewrite. The smoke found a D107 gap: the scan recorded a static definition's NULL callers but never its own body, so a static callee with a NULL test and a NULL caller rendered non-null and its test folded. A static definition now records its own evidence as a header-owned inline does (name-keyed: a second static of the same name in another unit keeps the first's). The nullable selfhost case gains a static callee.
…re indexed; the generic gate hooks leave the module context alone The re-promote under static-definition evidence found three defects: the resolver's sink-chain walk had no visited set and went exponential over helpers that forward one callback to several (tommyds and c-algorithms ran past 20 minutes); find_symbol was a linear scan under it (now a key index kept at ensure_symbol); and the #2235 gate hooks called update_module_context for a generic declaration reached callee-first from inside another body without restoring it, so the rest of that body was checked under the wrong module (zlib's example.w failed an Option-to-Option assignment).
…helpers' tested or NULL-passed callbacks are Option
…ot the driver corpus_compile_binary built zlib's example and minigzip through the Workspace API, which is the driver — the pinned seed — with the seed's embedded bundle interface standing in for the corpus. The seed could no longer type the corpus (zlib's Option callbacks), so zlib-build failed under every fresh compiler that accepted the same file, and a migration that changed a signature could never pass it: the pcre2 cohesive check's defect, in the second place it lived. The binary is now the release compiler's as a subprocess, the corpus on its source and the prelude off.
…ce (a static caller passes NULL)
…ifferently on stage1 and the release compiler, #2248)
Contributor
Author
ehartford
marked this pull request as ready for review
October 7, 2026 13:04
This was referenced Oct 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One branch, seven layers, one battery:
c facadeover a function c_import omitted names the omission and its reason; a name both declared by the translation and recorded as omitted is a hard error.unsafe fncalls once, at its declaration (free functions and the owner's own methods).long,char,long double); a cross target hands clang its triple.rules.tsv; migrate_diff names the rules under each changed function. The smoke found that a static definition's own body was not evidence for its parameters (D107); fixed, corpora re-promoted.Gate green on f366957; battery pending.