Repository navigation
Description
Eric (2026-11-02): the spec is human-facing and has no build or test connection; its examples are maintained by hand. This issue is the hand audit: every fenced example in docs/spec/*.md and docs/spec/stdlib/*.md is read and tried with the installed compiler, by a person, and what is wrong is fixed in docs-only PRs. No lane, no tool reading the spec, no marker convention in the text.
Method
For each block: paste it into a file, run with check (and with run where the block is a program), and judge it one of three ways:
- Compiles and says what the prose says. Nothing to do.
- A fragment by design (
let y = x + 1 // if x is u64…, a signature, a desugar). Fine as long as the prose makes clear what it leaves out; otherwise complete it. - Wrong: stale syntax (
type Foo = {,|x| body), a name the library no longer has, an example that violates a later ruling. Fix the example under the ruling it illustrates; a spec sentence that is wrong is Spec errata from the 2026-11-02 conformance audit: examples that cannot compile, names that do not exist, and rules that contradict each other #2955's business and gets its own child issue.
Worklist (from a one-off sweep on 2026-11-02 with 018ea96c5; counts are blocks that did not compile as pasted, fragments included)
Chapters: 009_functions 69 of 78 · 004_types 62 of 94 · 016_ffi 40 of 52 · 014_concurrency 40 of 42 · 013_iteration 37 · 018_modules 23 · 011_traits 23 · 017_metaprogramming 17 · 010_errors 17 · 003_borrowing 15 · 007_with-scoped-access 14 · 015_strings 12 · 002_ownership 12 · 029_lexical-and-binding-rules 10 · 019_safety 4 · 012_closures 3 · 008_memory 3 · 005_ephemeral 3.
stdlib: std-math-spec 76 · libstd-spec 44 · regex-spec 32 · perl-compatible-re 10 · collection-operations 6 · regular-expressions 4 · output-functions 4 · channels 4.
The most common diagnostics were undefined variable (fragments), expected expression / expected ':' or '{' to introduce body (stale or pseudo-syntax), drop '=' in struct type declarations (87 blocks of pre-D-era type T = { syntax), use 'enum' for enum declarations, use 'x => body' instead of '|x| body', and unknown type 'User'/'Config'/'IoError' (fragments naming prose types).
Known defects already filed: #2955 and its children (50.millis(), timeout(...), Ok(a + b), String, the §13.6 example under D108).
Done when
Every block in the chapters and stdlib docs has been read and tried by hand, each is (1) or an honest (2), every (3) is fixed or filed, and this issue lists the PRs that did it, chapter by chapter.
Activity
ehartford commentedon Nov 2, 2026
Eric (2026-11-02): any problem with an example indicates one or more of three things, and the audit decides which with an open mind:
Never presume it is the example, and never presume it is the compiler, when it may well be the spec itself, or the example, or the compiler. Settle it by running (the code settles facts), then fix the correct problem: an example under its ruling, a spec sentence through a ruling (#2955's class), a compiler defect as a bug with its fixture. The "Method" above is amended by this: a block that does not compile is not filed under "wrong example" until the other two have been ruled out.
D126 (#2944): the slice demand's fixture spells the slice `[]T`; `&[]…
#2987: hand-audit spec examples across §§1–3, 5–8, 10, 12, 14–15, 17,…
ehartford commentedon Nov 5, 2026
Batch 1 landed in #3043: hand-tested every fenced block across
001_design-goals.md,002_ownership.md,003_borrowing.md,005_ephemeral.md,006_handles.md,007_with-scoped-access.md,008_memory.md,010_errors.md,012_closures.md,014_concurrency.md,015_strings.md,017_metaprogramming.md,019_safety.md,020_performance.md,021_borrow-checker-rules.md,022_ephemeral-rules.md,023_with-block-semantics.md,024_async-equivalences.md,029_lexical-and-binding-rules.md, plusstdlib/channels.md,stdlib/send-sync-scopedsend.md, andstdlib/synchronization-primitives.md. Surfaced and filed compiler/stdlib gaps #3038, #3039, #3041, #3042 and prose errata #3040.ehartford commentedon Nov 5, 2026
Completed the manual example audit across every chapter in
docs/spec/*.mdand every document indocs/spec/stdlib/*.md:Chapter-by-chapter record
001_design-goals.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)002_ownership.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043003_borrowing.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043004_types.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050005_ephemeral.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043, #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050006_handles.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)007_with-scoped-access.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043008_memory.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)009_functions.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050010_errors.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043011_traits.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (filed §11.7: expr[index] does not dispatch to IndexGet[I, V] and rejects non-integer I on IndexPlace[I, V] #3046, §11.7: MultiIndex trait signature fails without explicit IndexSpec import, and IndexSpec is a flat struct instead of the spec's enum #3047, §11.6: blanket impls (impl[T: Bound] Trait for T) satisfy trait bounds but fail method call resolution ('unknown method') #3048)012_closures.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043013_iteration.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050014_concurrency.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (filed Codegen: monomorphizing a generic function inside an async: block leaks async_block_rbuf (LLVM verification failure) #3038, std.sync (§7.1, §7.5, §7.7, §14.3, §14.17): Mutex.lock() and RwLock.read() / RwLock.write() guard methods missing #3039; in flight in #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045)015_strings.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)016_ffi.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (filed §16.11: raw-pointer-to-slice conversion slice(p, len) is missing #3049)017_metaprogramming.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043, #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045 (filed Comptime (§17.6): str.bytes() / str.as_bytes() fails on (*self) as []u8 cast #3041; in flight in #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045)018_modules.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050019_safety.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043020_performance.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)021_borrow-checker-rules.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043, #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050022_ephemeral-rules.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)023_with-block-semantics.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)024_async-equivalences.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)029_lexical-and-binding-rules.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)030_grammar.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (grammar productions only)docs/spec/stdlib/recordchannels.md— audited and updated in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043send-sync-scopedsend.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (no example defects)synchronization-primitives.md— audited in #2987: hand-audit spec examples (batch 1: §§1–3, 5–8, 10, 12, 14–15, 17, 19–24, 29, channels) #3043 (filed std.sync (§7.1, §7.5, §7.7, §14.3, §14.17): Mutex.lock() and RwLock.read() / RwLock.write() guard methods missing #3039; in flight in #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045)collection-operations.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050output-functions.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (no example defects)regular-expressions.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (no example defects)string-conversions.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (no example defects)standard-library-design.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (no example defects)std-encoding-rfc4648.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (compiled and ran againstwith)regex-spec.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050perl-compatible-re.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (proposed conformance spec; existing §4 block valid)std-math-spec.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (D27 note tracked in Plan docs still spell &mut parameters — respell per §15.1/D27 before implementing #739)libstd-spec.md— audited and updated in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (D27 note tracked in Plan docs still spell &mut parameters — respell per §15.1/D27 before implementing #739)stdlib_inventory.md— audited in #2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30) and stdlib docs #3050 (tables only)Implementation gaps filed during the audit
async:block monomorphizationasync_block_rbufleak — in PR #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045)Mutex.lock,RwLock.read/write/set, guard aliases — in PR #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045)Errortrait derive/ergonomics)str as []u8andIter[T]loops incomptime— in PR #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045)List.traverseexpected-type propagation — in PR #3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 audit #3045)async:block capture ownership)IndexGetand non-integerIndexPlacedispatch)MultiIndex/MultiIndexMutIndexSpeclowering and scope)impl[T: Bound] Trait for Tmethod dispatch)slice(p, len)conversion)#2987: hand-audit remaining spec chapters (§§4, 9, 11, 13, 16, 18, 30…
#3038, #3039, #3041, #3042, #2958: five spec-gap fixes from the #2987 …