Repository navigation
Release v0.2.82
Patch release v0.2.82
Changes
The values-by-default language migration is complete. str is unsized and has no value spelling: a string view is &str or &(str, static), a range of a str is a &str projection (str.slice_copy is deleted), and yo fix --migrate is gone. The soundness claim (S) is not made in v0.2.82: this release closes six S1s, but fourteen root-level issues/ docs still carry **Severity:** S1 at the release tip (seventeen at v0.2.81), none of them filed this cycle.
Type checking
- Breaking: a value
stris E0619. A parameter, result, field, element or type argument spelledstr(s : str,-> str,ArrayList(str),Option(str)) is rejected. The help names&strfor a lend,&(str, static)(a literal's type) for a result, field or collection element, andStringfor owned bytes.&s(a .. b)is a&strprojection that carriess's origin (static whensis), through newIndex(Range(usize))andIndex(RangeInclusive(usize))impls onstrthat clamp asslice_copydid.str.slice_copyandstr.slice_copy_inclusiveare deleted;String's and the collections' stay. Copying a&strparameter into a&(str, static)result or field is now E0923, which the alias used to launder. markdown-yo needs v0.0.32 with this compiler (v0.0.31 spells a valuestr) (#2198). - A
&mutpayload reached through a&scrutinee is read-only (S1). Inmatch(e, …)withe : &E, ormatch(&x, …), a binding of a&mutpayload is now a&reborrow: a write through it,r.* = v, a pass to a&mutparameter and a store in a&mutfield are E0908, naming "a&mutreference reached through a&borrow". They compiled and gave two&muthandles to one place, andderive(Clone)on an enum with a&mutpayload copied the exclusive borrow; it now fails at the derive. A&mutfield destructured from a&source ({ r } := h,h : &H) follows the same rule. A&mutor consuming match keeps the payload writable, andcheck ./srcandcheck ./stdfound no new rejection (#2197). - A holder with a spelled origin holds what a
&mutcallee stored in it (S1).c.put(&xs(usize(0)))onc : Keep(xs)(and the same store through a free function or a trait method) now freezesxs(usize(0))whilecis live: growingxsis E0911, where it was accepted and read freed memory under ASan. A&mutlend's write-back also no longer drops the loans the holder held before the call, so a callee that stores into one tuple slot, or stores conditionally, keeps the old loan checked (S1) (#2191). - A borrow of a holder, and a value copied out of one, carry the loans the holder joined after its binding (S1). With
d = .Some(&xs(usize(0)))assigned afterd's binding,c := &dandcopy_into(&mut c, &d)now freezexs(usize(0))whilecis live (E0911 namingd); growingxswas accepted and read freed memory under ASan. A chain (e := &c) works, and a loan that a later whole-holder assignment ended is not carried (#2204). - In an
AllowUnsafefile, a&borrow through a dereference stays read-only (S2).r := &xs.*registers no loan there, and the checker read the binding as&mut: aforover it took the mutable cursor and rewrote the caller's elements, and&mut r.*andmatch(&mut r.*, …)compiled. They are E0908, as in safe code (#2183).
Standard library
- Breaking:
append_toand theFormattrait are deleted.${x:spec}on aDisplaytype is the one spelling:std/fmt/format.yoand its 26impl(_, Format())lines andDisplay's sevenappend_tomembers are gone, andstd/fmtno longer exportsFormat(#2188). - Breaking:
std/fmt/to_string.yoisstd/fmt/display.yo. The file holdsFormatter,DisplayandDebug; import it asimport("std/fmt/display"), with no forwarder.import("std/fmt")is unchanged (#2189, #2200). - A spec'd interpolation no longer allocates a rune list. The spec scanner reads the spec's bytes in place: 40
${n:>8}parts make 171 heap allocations instead of 291 (valgrind, system allocator), with byte-identical output and unchanged E0931 positions (#2185). - A compile-time
-or~returns the trait'sOutput. The comptime dispatchers returncomptime(_Self.Output)as the runtime ones do, so aComptimeNegorComptimeBitNotimpl whoseOutputis notSelfworks (n :: -CtV(x : i32(3))is aCtW) (#2192). derive(Clone)andderive(Hash)treat aBox,Rc,ArcorArrayListfield like any other. It is cloned asself.f.clone()and hashed asself.f.hash(hasher); a derivedCloneover anArrayList(R)field with a non-CloneRis now E0610 at the derive, namingR(#2186).
Toolchain for agents (CLI, LSP, test runner, diagnostics)
- Diagnostics state their rule without citing internal documents. Compiler errors and help, the
yo explainregistry (en and zh-CN),yo verify --helpand two runtime messages no longer point atplans/…, decision numbers,VERDICTS-N, plan sections, origin-rule ids orissues/…. Each message keeps its rule and its hint, and a stale promise ("until decision 43") now says what is true (#2201). - Docs. The manual (en-US and zh-CN), the pack and the instructions describe the language after values by default: no user doc sends a reader into a values-by-default plan, a string view is a reference (
strleaves theCopy, value-type and thread-safety lists),SHARED_OWNERSHIP.mdcounts the borrow pin, andFORMAL_VERIFICATION.md's "Two lists" section takes&/&mutlist parameters withrequires(distinct(src.*, dst.*))in a block that verifies (#2199).
Compile and codegen
- Breaking:
RcandArcrelease their count in aDropimpl, and source code cannot spell the compiler's drop.impl(Rc(T), Drop)andimpl(Arc(T), Drop)decrement the count;Rc.from_raw(p)andArc.from_raw(p)take over one strong count of a live cell, as in Rust, and replace__yo_rc_own;cloneandWeak.upgradebuild through them, and a raw__yo_cell/__yo_atomic_cellis inert storage. The compiler's drop is__yo_drop, accepted only in code the compiler synthesizes: it is rejected in anAllowUnsafefile, the prelude, a user macro and a derive rule's code string, with the helpdrop(x)orunsafe(drop_in_place(p)).___drop(x)is an unbound name,drop_in_placeruns on__yo_drop_in_place, and an error inside a derive rule's code string is located atauto-generated://comptime-string. The drop-glue label is__yo_drop_glue, and no___drop/___disposespelling remains (#2195, #2203). - A nested function's early return no longer frees a parameter twice (S1). A function defined inside another (
(fn(xs : T) -> R)(body)) that returned from inside aforover its parameter, where the enclosing body later moved a local of the same name, received the enclosing body's early-return drop and aborted with an ASan double free. The early-drop walk now stops at anfn(...) -> Rdefinition (#2193). - The dead effect-analysis code is deleted (about 1,850 lines:
effect-analysis.yo,ExprInfo.effect_analysis, the evidence-parameter collection and three write-only context fields); the compiler's own emitted C is byte-identical (#2196).
Build system and verification
- A run-time
ensuresis checked on everyreturn(S1). An earlyreturn(v), including one from acond/matcharm or aforbody, skipped the contract; each exit now binds its value, asserts the clauses and yields it, andverify+strips a proved clause at every return site. A bare variant under anensures(.Ok(...)at a block tail,return(.Err(e))) is inferred at the declared result type, where it failed (S2). Anensureson a function whose body installs an unwinding handler (anunwind(...)at function-literal depth 0 or 1, also through a macro expansion) is the new E0932, with the help to move the handler into a helper without anensures(#2190).
Compiler performance and memory
Rc/Arc'sDropimpls are neutral on the compiler. A/B against develop0eace61eb, both stage-2 binaries built with clang-O2: stage-2check ./srcuser-mode instructions 7,137,916,482,144 → 7,118,363,707,440 (−0.27%); stage-2 binary 21,464,384 → 21,460,792 bytes (−0.02%); the emitted C ofsrc/main.yo144,710,838 → 145,763,043 bytes (+0.73%) and 2,108,883 → 2,181,980 lines (+3.47%, mostly theOption(handle)NULL bracket, now three lines around the drop-glue call). Wall time on the loaded box was noise, and the bootstrap fixpoint holds (#2195).
The claim
Claim (L) is made: the values-by-default language migration is complete. Test 7 passes on this release's tree; the soundness claim (S) is not made: known S1s remain open in safe code. On a4083b16a, the commit the release was gated on (the tagged commit above it is the version bump, which changes only the version string): leg (a), the origins corpus, rejects G-B's 632 unsound programs, accepts G-A's 150 and leaves no origin rule without a sink; leg (b), the 2026-11-11 audit's probe corpus, rejects 1,734 of its 2,038 safe-code programs, crashes the checker on 6 (a loud failure, not an acceptance) and accepts 298, none of which leaks or runs dirty under ASan (280 run clean, 9 fail to compile in C, 9 exit non-zero); leg (c), the G-D borrow-program generator, finds nothing new in 291 programs (run 46530718762). The release G4: the compiler rebuilt from its own emitted C under AddressSanitizer and LeakSanitizer runs check src/main.yo with exit status 0, 0 AddressSanitizer errors and 0 leak blocks (4 h 30 min on a loaded machine, peak RSS 4.91 GB). This release closes the S1s named above (a &mut payload through a shared scrutinee, the spelled-origin holder lent &mut, the holder borrow that missed later-joined loans, the nested function's double free, the early return that skipped ensures, and the derive that copied an exclusive borrow); it does not close rule D1's thread-reach walk (issues/2026-11-11-the-d1-thread-reach-walk-does-not-see-drop-so-a-value-dropped-on-another-thread-races-on-a-global.md, issues/2026-11-11-the-d1-thread-reach-walk-trusts-every-std-body-including-the-user-impls-a-std-generic-calls.md) among the fourteen open S1 docs.
Retracted claims
- v0.2.81's
SHARED_OWNERSHIP.mdsaid "a clone is one increment, dropping a handle is one decrement, and a move is free: the compiler adds no other count operation". A local borrow of a place behind a handle (r := &h.*.x) holds the cell for as long as the borrow lives, andRc.strong_countcounts it; the page now says so (#2199). - v0.2.81's
FORMAL_VERIFICATION.mdsaid "ArrayListis a reference type", and its "Two lists" example mutated a by-valueArrayListparameter, which is E0917. The section now takes&/&mutparameters, and its example verifies (#2199).
Known open issues filed this cycle
issues/2026-11-30-a-derive-rules-code-string-runs-raw-pointer-operations-in-a-safe-file.md(S2: a derive rule's code string launders the unsafe, private-member and__yo_gates)issues/2026-11-30-a-field-write-through-a-mut-match-binding-of-a-mut-payload-has-no-error-code.md(S3:r.n = von a&mutmatch's&mutpayload fails without a code)issues/2026-11-30-a-lend-through-a-static-reference-is-second-class.md(S2: a-> &(T, static)function cannot return a static lend such as&Gor&s(a .. b)of a staticstr)issues/2026-11-30-a-return-in-a-function-literal-inside-a-reference-result-body-is-rewritten-as-the-results.md(S2: a nested literal'sreturnis rewritten as the outer reference result's)issues/2026-11-30-a-string-literal-cast-to-a-u8-pointer-is-emitted-as-a-bare-c-literal.md(S3: a literal cast to au8pointer emits a bare C literal)issues/2026-11-30-in-an-allowunsafe-file-a-mut-borrow-through-a-shared-reference-field-is-accepted.md(S2:&mut h.r.*over a&field in anAllowUnsafefile)issues/2026-11-30-the-element-drop-intrinsics-drop-nothing.md(S3:__yo_drop_array_element/__yo_drop_tuple_elementlower to a comment)issues/2026-11-30-the-reference-is-copy-read-rule-is-complete-only-for-str.md(S2: the&T-is-Copyread rule covers only&str)issues/2026-11-30-the-str-operator-arm-stays-until-the-string-eq-str-twins-select.md(S3: thestroperator arm waits for theString/&strEqtwins)issues/fixed/2026-12-01-a-static-field-read-through-a-reference-is-e0923-at-a-static-parameter.md(S2, regression from #2198: passing a&(str, static)field read through&Sorself : &Selfto a&(str, static)parameter is a false E0923, so code that stores a static slice from a borrowed struct fails to build; fixed on develop by #2225 for v0.2.83)
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.