Diagnostics Reference
Every Zynx error and warning carries a stable diagnostic code — ZP0001, ZA0002, and so on. The code is printed alongside the message, and is the part of a diagnostic that stays constant even if the wording around it changes.
Run zynx --explain <CODE> to print the full explanation for any code, including the rule it enforces and how to fix a violation:
$ zynx --explain ZB0001
ZB0001: borrow-after-move
a value is used after it was moved out of
Moving a value transfers ownership; the source binding is left empty and
may not be read afterwards. Either borrow the value instead of moving it,
clone it if a second owned copy is needed, or restructure so the move is
the last use.This page is a look-up appendix: one row per code, with a one-line summary. It does not teach the underlying language rules — those live in the language reference; this page is what the reference links to when it mentions a code. For the full explanation of any single code, use --explain.
Codes are grouped by a letter prefix that identifies the compiler stage that raises them, followed by four digits. Numbering within a prefix is not sequential — gaps are reserved for related diagnostics added later.
ZP— parsing and syntaxZA— name resolution, types, and semantic analysisZB— borrowing, ownership, and movesZC— code generation and ABI
Parse diagnostics (ZP)
| Code | Meaning |
|---|---|
ZP0001 | An item that is not a top-level declaration appears at module scope. |
ZP0010 | An expression was required here but the parser found something else. |
ZP0011 | A type was required here but the parser found something else. |
ZP0012 | A struct body contains something that is not a valid member. |
ZP0030 | A match arm does not begin with a valid pattern. |
ZP0031 | A match arm pattern is not followed by an arm body. |
ZP0032 | An identifier does not satisfy the Unicode identifier rule. |
ZP0033 | Two match arms are not separated by a comma. |
ZP0034 | Legacy thread_local var/thread_local let syntax must migrate to a module-level ThreadLocal<T> descriptor. |
ZP0035 | A tuple destructuring pattern is introduced with const. |
ZP0036 | A struct field is declared with const. |
ZP0037 | A type uses the removed const read-only-view prefix. |
ZP0038 | Migration mode found a legacy writable bare pointer that must become *mut T. |
Analysis diagnostics (ZA)
| Code | Meaning |
|---|---|
ZA0001 | A value's type does not match the type required by its context. |
ZA0002 | A name does not resolve to anything in the current scope. |
ZA0010 | A type argument does not satisfy the interface bound on a generic parameter. |
ZA0011 | A generic item is instantiated with the wrong number of type arguments. |
ZA0012 | A type name does not resolve to anything in the current scope. |
ZA0013 | A const generic argument does not fit in its declared parameter type. |
ZA0030 | A call names a function that does not resolve in the current scope. |
ZA0031 | A closure is called with the wrong number of arguments. |
ZA0032 | A call targets a name that is not a function or initializer. |
ZA0050 | A builtin was called with the wrong number of arguments. |
ZA0051 | A builtin argument has a type the builtin does not accept. |
ZA0052 | A name written as @name is not a known builtin. |
ZA0070 | Member access is used on a value whose type has no members. |
ZA0071 | A struct value is accessed through a field or method it does not declare. |
ZA0072 | A readonly field is assigned from outside its declaring struct. |
ZA0073 | A private field is accessed from outside its declaring struct. |
ZA0090 | An arithmetic operator was applied to a non-numeric operand. |
ZA0091 | The two operands of an arithmetic operator have different types. |
ZA0092 | A bitwise or shift operator was applied to a non-integer operand. |
ZA0093 | The two operands of a comparison have different types. |
ZA0094 | A comparison operator was applied to an operand it does not support. |
ZA0095 | A unary operator was applied to an operand it does not support. |
ZA0110 | A returned value's type does not match the function's declared return type. |
ZA0111 | A function with a non-void return type returns without a value. |
ZA0112 | A value is returned from a function that returns no value. |
ZA0113 | A thrown error is not a member of the function's declared throws(...) set. |
ZA0120 | A struct literal names a field the struct does not declare. |
ZA0121 | A struct literal initializes a private-by-default field that was not exported. |
ZA0122 | A struct literal initializes the same field twice. |
ZA0123 | A value in a struct literal does not match its field's type. |
ZA0124 | A struct literal does not initialize a required field. |
ZA0140 | A match does not cover every possible value of its scrutinee. |
ZA0141 | A match pattern names a variant the enum does not declare. |
ZA0142 | A match arm's pattern does not match the type of the scrutinee. |
ZA0160 | Two enum variants resolve to the same discriminant. |
ZA0161 | An enum variant discriminant does not fit the backing type. |
ZA0162 | An explicit discriminant was given on a non-C-ABI enum. |
ZA0163 | A C ABI enum variant carries a payload. |
ZA0180 | A from import names a member the module does not export. |
ZA0181 | A from import names a member the module declares but does not export. |
ZA0200 | An init leaves a field without a default uninitialized. |
ZA0220 | A call does not match the signature of the only function with that name. |
ZA0221 | No overload of a function accepts the supplied arguments. |
ZA0241 | A type alias refers to itself through its own definition. |
ZA0242 | An array literal has a different number of elements than its declared size. |
ZA0243 | A @noreturn function declares a return type other than void or never. |
ZA0260 | A closure sent across worker threads captures a value that is not send-safe. |
ZA0280 | A const binding is assigned to after its initial value. |
ZA0281 | An immutable binding is assigned to after its initial value. |
ZA0282 | A mutable reference is taken to an immutable binding. |
ZA0283 | A mutating &self method is called on an immutable binding. |
ZA0284 | A field or element of an immutable binding is assigned to. |
ZA0285 | A local const binding's initializer is not a compile-time constant. |
ZA0286 | An immutable binding is initialized from inside a loop. |
ZA0300 | A named owned place is passed to a ^ parameter without an explicit <-. |
ZA0301 | An owning position uses a bare move-only type instead of ^T. |
Borrow and ownership diagnostics (ZB)
| Code | Meaning |
|---|---|
ZB0001 | A value is used after it was moved out of. |
ZB0002 | A value is accessed while an incompatible borrow of it is still live. |
ZB0003 | A borrow is captured by something that outlives the borrowed value. |
ZB0004 | An owned value is moved out of a shared borrow. |
ZB0005 | An owned element cannot be moved out of this place. |
ZB0006 | A range-slice view cannot be coerced into an owning slice. |
Codegen and ABI diagnostics (ZC)
| Code | Meaning |
|---|---|
ZC0001 | A type cannot cross the declared foreign ABI boundary. |
Coverage
Every code above is wired to a real emission site in the compiler; none are placeholders. The registry does not currently define any internal-only or selftest-only codes, so nothing was excluded from this page.