Repository navigation
Patch release v0.2.83
Changes
Type checking
- Breaking:
try(expr)returns a failure from the enclosing body.try(r)gives the.Okvalue of aResult, or returns.Err(e)from the nearest function, closure orio.asyncbody;try(o)does the same for anOptionand.None. An error of another type converts throughFrom, and the early exit drops its locals and checksensures. A non-Result/Optionoperand, no enclosing body, or atryin atest(...)body is the new E0934; an error type with noFromis E0935.tryis now a reserved builtin, so a binder namedtryis E0407 (#2223). - Breaking: a
Stringlends its bytes as a&strthat borrows it, andString.slice_copyis deleted.s.as_str(),&s.*(throughimpl(String, Deref(Target : str))) and the range&s(a .. b)give a&strover the string's own bytes with its clamping and rune-boundary rules; the owned copy iss.substring(a, b)orString.from(&s(a .. b)). The view is neverstatic: it is rejected at every&(str, static)slot (E0923), anOption(&str)over it in anRcis E0909, and a write to, move of ordropof the string while the view lives is E0911.String.slice_copyandslice_copy_inclusiveare deleted. A projection lend under an annotation ((l : &(str, static)) = &s.*) skipped the annotation's origin check and was accepted (S3); it is checked now (#2207). - An
Allocatorbuilt from a local's address can no longer outlive that local from safe code (S1). A store through a reference, a call that can store it through a&mutargument (xs.push(a),set(&mut dst, a),mem.replace), a module-level store of a parameter, and a read through a local reference now fail like a plain assignment did; placement (Box.new(v, alloc : .Some(c.allocator()))) stays accepted. The raw-pointer flowability gate judges the place each write lands in. Passingioor a closure that stores a parameter through a&mutcapture or another&mutparameter (StreamTake.next,Mutex.with_lock,HashMapEntry.and_modify) is accepted, and every call that hands over or invokes a closure judges its arguments against what the closure's&mutcaptures reach; calling anFnclosure parameter, which writes no&mutcapture, stores nothing (#2247, #2250, #2252). - A thread closure is checked through what it reaches by destruction and through std (S1 x3). Rule D1 now sees a value whose
Dropreaches a non-Syncglobal, follows a userEq/Displaythat std calls on the user's behalf (contains,println), and walksifconditions andmatchguards. Each is E0602 when unsound, and each raced on a global under TSan before. "Known Holes" inTHREAD_SAFETY.mdis now "None known" (#2241). - A fixed-origin impl no longer satisfies a bound whose reference argument elides the origin (S1, E0602).
impl(Keep(p), Resume(&(T, p)))passed aResume(&T)bound and let a reference outlive its origin. The comptime-call memo now rebuilds a trait called with a different origin spelling, so the bound is not read as if it spelledp. The rule rejects nothing instd/orsrc/(#2233). - A store between two reference fields of one parameter is E0923, and an inline constructor's
&mutfield takes the write-back of its sibling fields (S1).arg.out.* = .Some(arg.world)was accepted, andstash(Feed(w)(world : &w, out : &mut seen))leftseenholdingwwith no E0911 on a later read. Both read a dead stack slot under ASan (#2233). - A
&mutheld in a value reaches the mutation summary (S1, E0908).poke(.Some(x))andpoke(Holder(p)(r : x))hid the write fromf(x : &mut i32), sog(b : &Plain) { f(&mut b.n) }was accepted: a write through a&Tparameter. Four gaps in the summary compose, and all four are closed. Two further ref-era S1s (a move-only element borrowed for a call, a forwarded walk over an inner collection) are confirmed fixed by earlier work and pinned with new rows (#2229). - A generic function item at a run-time slot is rejected at check time (S1). An argument, untyped
:=, struct field or function result naming agenericfn (id(_len),h := _len) was accepted bycheckand failed in C. It is E0601 with the closure repairv => _len(v), or E0613 whenTcannot be inferred;h :: _lenis unchanged (#2246). - A member read off a bare trait is the new E0628 (S1).
View.view(c)andDefault.default()passedcheckand read an undeclared C type. The help names the implementing type,(C <: View).view(c), and the called form carries a repair (#2246). - A recursion at a growing instantiation stops after 128 levels with the new E1106. The error carries a
first:and anow:note;YO_DEBUG_SPECDEPTH=1traces the depths (#2246). - A
staticfield read through a reference passes to a&(str, static)parameter (S2, regression from v0.2.82).take(s.src)fors : &S,&mut S,selfor a local reference binding was a false E0923 ("the value holdss"). The E0923 at an argument now names the parameter and prints&(str, static), and the E0619 field message has its comma (#2225). - An associated-type binding
Item := &Tis a reference type, not a local borrow.Iterator(Item := &T),Item := &mut Tand aCoroutineYield := &Tfailed with "Expected identifier for associated type label, got: __yo_imm(...)"; the local-borrow rewrite now applies only to statements (#2222).
Standard library
- Breaking: about 45 deprecated aliases are deleted. The module-prefix aliases (
base64.base64_encode,json.json_parseand the rest ofbase64,csv,hex,html,percent,toml,utf16,json) andString's eightparse_*methods (s.parse_u64()) are unbound, with no forwarder: E0403 for a module field, E0610 for a method. Use the module's own functions (json.parse_string,toml.parse) ands.parse(T)(#2208). - Breaking:
std/async'syieldis deleted. It duplicatedstd/async/waker'syield_now; the nameyieldis free for generators. The "blocking await inside a task" panic now saysawait yield_now(io)(#2217). - An aborted
TcpStream.connectorUnixStream.connectcloses its socket and frees its address (S1). Atimeoutaround a connect to an unanswering host leaked the descriptor and a 16- or 28-byte address buffer on every abort (the lowest free fd grew by one per abort, on both Linux backends). A thread whose io_uring is torn down with a cancelled operation in flight no longer leaks that operation's future. With these, the oldest open S1, the self-hosted-emit leak umbrella, is re-measured on Linux and closed: 41 of its 42 surviving corpus files were already leak-clean, and the 42nd wastests/net/tcp.test.yo(#2237).
Toolchain for agents (CLI, LSP, test runner, diagnostics)
yo fix --errors-as-valuesconverts handler-style functions toResult-returning ones. It evaluates the files, resolves every call, turns anExceptionparameter orIoExnrow intoResult(T, AnyError), makes throws return.Err, passes calls on withtry(...)and turns catch handlers into amatchat the call. What it cannot convert (trait members, contract clauses, more than oneExceptionparameter,-> never) is listed, and what it cannot adapt safely (aspawnof a now-fallible future, a handler named in a template string) is reported with rc 1.--callers <path>adapts calls outside the converted paths (#2238).- E0601 at a
&Stringargument in a&strparameter names the repair.s.as_str()replaces&s, a field place or a&Stringvalue, andyo fixapplies it; method calls such asu.push_str(&t), which said onlyCannot unify incompatible types: "str" and "String", now carry it too. When the source does not spell the place as the help does, the help is given without a guessed edit (#2244). yo context --path <std copy>evaluates the tree against itself. A tree holding aprelude.yois its own std root, as foryo check ./std; before, 136 of a copy's 172 modules fell back to token-only docs against the binary's bundled std, and that degraded index then poisoned the cache for the plain bundled query. The cache key now names the evaluating std, so existing context caches rebuild once (#2221).- Docs. The manuals and about 45 std modules' doc comments no longer narrate history or pre-values-by-default spellings, and the docs check is a blocking CI gate.
pack/context.mdshrinks from 29,020 to 23,971 bytes under a 24 KiB cap, with the depth moved toSYNTAX.mdandOWNERSHIP_AND_BORROWING.mdin both languages (#2211).
Compile and codegen
- A self-recursive generic function specializes once per instantiation (S1). The specialization cache was stored only after the body was evaluated, so a recursive call at the same instantiation minted it again without end: a SIGSEGV on develop and a hang on v0.2.82. A recursion at a growing instantiation is the E1106 above (#2224).
- A generic body at
T := &Ccallsimpl(&C, ...)'s method, and a namedfnat a&mut Impl(FnMut)slot is passed as the fn pointer (S1). Both emitted mismatched C pointer types (C const *againstC *, and(void**)(&fn)) that clang rejected; the second also covers a call forwarded through a second slot (#2224). - An
FnOnceclosure whose body is a bare capture no longer leaks its environment (S1). It was already clean since v0.2.74; a regression test now pins theRc,Box,String,ImplandDynshapes (#2224).
Async runtime
- A function that takes
Impl(Future(T, E))by value is specialized per future type, andYO_DEBUG_AWAIT_GRAPH=1prints the await graph. A function taking a future is emitted once perio.asyncinstance, as one taking anImpl(Fn)is per closure, and its parameter has the instance's concrete C type instead of the erased__yo_future_trait_*pointer. The evaluator records the await graph (anio.awaitis an edge to the instance its operand resolves to, found through recursion too) and prints one line of counts plus one line per cycle;=2also lists each non-static await site. The cycles and the=2site list are sorted, so the output is the same from run to run (#2218, #2228). - An
io.asyncfuture is its captures until it starts, so a future made and dropped costs no cell. The state machine or sync future is allocated when the future is first awaited, spawned or stored in an erased slot; a future dropped cold drops its captures once. A trait default awaiting a generic impl'sio.asyncmethod throughSelf(Reader.read_to_endonBufReader) and atimeoutresult pending across a call that may unwind compile and drop correctly (#2240).
Build system and verification
- Breaking:
logicandlemmareplaceghost_fn. Alogicfunction is total and has a value; alemmareturnsunit(or a labelled ghost value, below) and claims anensures. The head decides the form, not the literal's shape, and reports name themlogic@<file>:<row>andlemma@<file>:<row>. Alogicfunction returningunit, alemmawith noensures, and an unlabelled value from alemmaare E0930.ghost_fnis read aslogicunderstd/only and is the new E0933 elsewhere;yo fixrenames it by shape. LSP hover marks the form, and the VS Code and Vim grammars highlight both words (#2226). - A lemma may return a labelled ghost value.
ghost(k := lemma(args));proves the lemma'srequiresat the use and learns itsensuresaboutk. Inverify+, a proof resting on an unproven lemma is capped atunproven, because a lemma never runs and leaves no assert behind; a lemma markedassumed()caps nothing (#2227). yo verifyproves a function'sensuresat every exit. An earlyreturn(v), and sotry(expr), is proved withvas the result and reported asensures#N@row:col. Amatcharm is walked under its own pattern, where a true obligation in an arm was refuted with a counter-example the arm can never see (S2). A callee'sResultover a user error enum no longer fails with a Z3 "unknown sort" error, anddyn(Box.new(e))at anAnyErrorslot is an opaque value.Odd.EvenforOdd :: enum(Odd, Even)was read as a payload form and reported "unbound runtime name" (S3); it resolves now (#2239).- The verify cache no longer re-proves every function below an inserted line. The key is the query with its generated names renamed by first occurrence and its sort and datatype declarations pruned to the ones it names, so source positions, the entry's path and earlier functions do not reach it;
yo verify <file>andyo verify <dir>now give one function one key (#2216). yo verify --jobs <n>runs the solver in parallel. Cache misses run as a pool of Z3 processes, one per hardware thread by default;yo compilepasses its own--jobs, and the verdicts do not depend on the pool size (#2231).- The release's Z3 is fetched with the compiler, and a missing or broken solver is one line per run. Every release publishes the pinned Z3 as
yo-v<version>-<triple>-z3.tar.gz(static musl on Linux, the static CRT on Windows; 8 to 14 MB instead of the official 157 MB).install.sh,install.ps1(--no-solver/-NoSolverskips it),yo version installandyo verifyfetch it, andyo buildfetches it on first need;check,compileand the LSP never touch the network. The solver lives in<yo cache>/solvers/z3-<pin>-<triple>/(on Windows%LOCALAPPDATA%\yo\cache, where it used to be~/.cache/yoon every OS). A missing solver, aYO_Z3_PATH/--solver-pathnaming no file and a binary whose--versionfails are one probe per process, one line instead of aSOLVER-ERRORblock per function or a line per file;--require-solver/YO_REQUIRE_SOLVER=1make it an error whenever proofs are to run, and the solver is in the artifact stamp (#2219, #2220). yo checkandyo compileprint no verifier line for a function with no contract and nothing checked in its body. A project underpragma(Pragma.VerifyOrAssert);printedn/a ... outside the verifiable subsetorok ... no obligationsfor each, so it could not build silently.yo verifyoutput is unchanged (#2214).
Compiler performance and memory
- Re-verifying after a one-line insertion re-solves nothing. On a 70-function module (140 queries, Z3 5.1.0), the run after inserting a line re-solves 0 of 140 queries in 20 ms of solver time, against 140 in 9,458 ms; on 280 functions, 560 of 560 are cached in 129 ms (#2216).
yo verify --jobs 16solves 5 to 6 times faster. A 280-function module (560 queries) takes 6.7 and 7.1 s of solver time instead of 41.4 and 42.5 s at--jobs 1; a 70-function module takes 2.0 and 1.9 s instead of 10.4 and 9.9 s. Wall time on the loaded box falls from 56 s to 20 s. No verdict differs, in 0 of 560 queries (#2231).io.asyncfutures that are dropped cold allocate no cell. The new cli case drops from 2.50 to 1.50 cells per task (2 state machines and 2 sync futures become 1 and 1); a mixed probe drops from 8 state machines to 7.src/main.yo's emitted C grows 147,035,669 to 147,109,470 bytes (+0.05%, 161 future values) and the C compile's RSS 1,943,960 to 1,945,004 KB. Per-iterationasync-chain(instructions:u; chain / select / timeout / spawn / pingpong) under clang 21 is 1,447 / 1,923 / 3,835 / 214 / 3,402 to 1,436 / 1,939 / 3,821 / 211 / 3,402; under gcc 15.2 it is 1,180 / 1,439 / 2,964 / 179 / 2,552 to 1,210 / 1,446 / 2,972 / 188 / 2,539, sochainis +2.5% andspawn+5% (not profiled; AFA-3 replaces both paths at static sites) (#2240).check ./srccosts more memory and allocations. Rule D1's walk through std bodies takescheck ./srcfrom 2.290 GB to 2.457 GB maxRSS (+7.3%, the same in two rounds) with no measurable CPU change (user+sys 2188.7 s to 2206.7 s, then 2346.5 s to 2335.3 s) (#2241); the trait-instance restamp takescheck ./std/collectionsfrom 96.9 G to 99.4 G instructions:u (+2.5%, spanning a develop merge) (#2233). Over the whole batch the evaluator work ratchet counts 5,537,718,364 allocation calls forcheck src/main.yobefore and 5,912,245,043 after (+6.8%): +1.0% atabce3de78(leaks, E-2, E-1v, AFA-2) and +2.8% at3a218d061(D1, S-0, cg3r, the flowability gate). The develop battery'scheck src/main.yomax RSS went from a 2,222,504 KB baseline to 2,447,372 KB (+10.1%) over the same batch. Both baselines were moved and the cost is not yet recovered (#2251, #2252).
Known open issues filed this cycle
issues/2026-11-30-a-call-through-a-local-closure-is-read-as-a-collection-element-by-a-match-scrutinee.md(S3:f(x)through a local closure as amatchscrutinee is read as an indexed projection and fails with E0901)issues/2026-12-01-a-generic-impl-never-matches-when-the-receiver-does-not-bind-a-trait-argument.md(S2: a forwarding impl over a parameterized trait never applies, soBox(C)or a user wrapper cannot forward one; fix scheduled for v0.2.88)issues/2026-12-01-a-runtime-ensures-rejects-a-body-whose-every-path-returns.md(S2: a function with a run-timeensureswhose body leaves throughreturn(...)on every path does not compile; make the last exit a value)issues/2026-12-01-std-http-ignores-https-proxy-so-yo-cannot-download-behind-a-proxy.md(S3: the compiler's own downloads (solver fetch,yo version install) ignoreHTTPS_PROXY)issues/2026-12-01-the-solver-spawn-does-not-quote-its-paths.md(S3: a Z3 under a path containing a space cannot run, as on a Windows user name with one)issues/2026-12-01-yo-check-rejects-tests-internal-verifier-test-yo-with-e0928-in-a-helper-called-from-assert.md(S3:yo checkof one compiler test file fails with E0928 whileyo testof it passes)issues/2026-12-02-a-closure-in-a-comptime-function-that-names-its-type-parameter-emits-the-parameter-unresolved.md(S2: passesyo checkand fails in the C compiler)issues/2026-12-02-a-fixed-origin-impl-called-through-a-spelled-bound-is-passed-the-address-of-its-reference-argument.md(S3: latent, the emitted C passes aT**for aT*)issues/2026-12-02-a-frame-that-installs-a-handler-and-forwards-an-outer-one-hands-its-own-unwind-to-the-outer-installer.md(S1: a frame's own handler unwinds and the outer installer's frame returns early with an empty result, a wrong value with rc 0; retires with ERRORS_AS_VALUES E-5)issues/2026-12-02-a-generic-binder-solved-only-by-a-where-clause-takes-the-argument-binder-type-when-declared-first.md(S3: withgeneric(A, I)the body readsAasI; the other order works)issues/2026-12-02-a-method-call-on-an-impl-result-over-an-origin-parameterised-type-fails-in-codegen.md(S2: passesyo check, then an internal compiler error (E1301) in codegen)issues/2026-12-02-a-mistyped-tag-is-reported-as-an-unfetchable-commit.md(S3: atag = "v9.9.9"that does not exist says the commit could not be fetched)issues/2026-12-02-a-one-element-array-literal-is-read-as-a-slice-type-with-no-hint-of-the-trailing-comma.md(S3: the diagnostic does not lead to[x,])issues/2026-12-02-a-system-library-that-pkg-config-cannot-find-fails-far-from-its-cause.md(S3: empty flags and a linker error far from the cause, plus a stray0.29.2line in every build that links a system library)issues/2026-12-02-a-type-nested-over-a-type-variable-costs-time-exponential-in-its-depth.md(S2:yo checkstalls on a generic body naming a type nested over a type variable; depth 16 takes 27 s, depth 18 takes 94 s)issues/2026-12-02-an-executable-is-not-relinked-when-a-static-library-it-links-changes.md(S1:yo buildsilently runs a stale binary after a linked library's source changed)issues/2026-12-02-build-module-link-and-dep-module-propagate-nothing.md(S2:module.linkis write-only, so a binding package cannot carry its system-library requirements to its users)issues/2026-12-02-i64-display-passes-an-int64-t-to-percent-lld-and-every-program-that-prints-one-warns.md(S3: a C warning in every program that interpolates ani64)issues/2026-12-02-std-build-doc-examples-and-stale-build-docs-do-not-match-the-code.md(S3:std/build.yo's module-doc examples use the removed record form,BUILD_SYSTEM.mdmisdescribes the.verifiedtree,yo initwrites an unused import)issues/2026-12-02-test-suite-target-is-declared-and-never-forwarded.md(S3: a build file asking for a cross-target test run silently tests on the host)issues/2026-12-02-the-d1-walk-rejects-a-value-whose-generic-drop-reaches-no-global-when-it-can-die-on-another-thread.md(S3: over-rejection, a generic userDropthat reaches no global is E0602 in a thread closure)issues/2026-12-02-the-deref-view-help-repeats-itself-for-a-reference-binding.md(S3: E0601's&r.*help repeats itself; the working form&r.*.*is named nowhere)issues/2026-12-02-the-integrity-hash-gives-one-value-to-different-trees.md(S2: three ways make two dependency trees hash alike, so the store can serve the first package's bytes to the second)issues/2026-12-02-unbounded-compile-time-function-recursion-hangs-yo-check.md(S2:yo checknever finishes on a comptime recursion with no finite depth; the fix reuses E1106)issues/2026-12-02-yo-build-locked-accepts-a-lock-that-does-not-satisfy-yo-toml.md(S2:--lockedbuilds the old tree after a pin was edited without regeneratingyo.lock)issues/2026-12-02-yo-build-uses-a-modified-store-tree-and-trees-are-writable.md(S2: an edited file instore/sha256/<hash>/is compiled and run with no diagnostic)issues/2026-12-02-yo-version-install-leaves-an-empty-staging-directory-when-the-download-throws.md(S3: every failed download leaves an empty directory under~/.cache/yo/versions/)issues/2026-12-03-a-local-fn-definition-cannot-call-itself-by-name.md(S2: a block-level::function that calls itself is E0401, thoughFUNCTIONS.mdsays a named function recurses by name)issues/2026-12-03-a-local-fn-definition-silently-reads-a-shadowed-module-level-name.md(S2: a block-levelfnnaming an enclosing parameter reads the module-level binding of the same name, a wrong value accepted)issues/2026-12-03-recur-in-a-capturing-closure-emits-a-call-missing-its-closure-context.md(S2:recurin a closure with captures fails in the C compiler, "too few arguments")issues/2026-12-03-the-e0401-did-you-mean-help-suggests-operator-names.md(S3: an undefinedkgetsdid you mean "?"?)issues/2026-12-03-the-v0-2-83-batch-raises-the-check-allocation-count.md(S3: the +6.8% allocation count ofcheck src/main.yoabove; root cause not pinned)
Native bundles (bootstrap seed chain)
The yo-v*-<os>-<arch>.tar.gz assets attached below are this commit's
self-hosted compiler, built by the PREVIOUS release's compiler — the
seed (bin/yo + std/ + vendor/mimalloc/ +
pack + LICENSE). The
TypeScript compiler that used to build them was retired in P2.5 and
is frozen at the src-attic-final tag. See
plans/archive/SELF_HOSTING_COMPLETION.md Phase 2 for the trust chain and
plans/archive/BOOTSTRAPPING.md for the campaign record.