Error Code Reference
This page is generated by scripts/docs/gen-error-code-docs.py from the define_codes! registry in src/util/diagnostic/codes/ and locales/en.json. Do not edit it by hand. Change the wording in locales/*.json, change the code table in define_codes!, then rerun python scripts/docs/gen-error-code-docs.py.
Every YaoXiang diagnostic carries a stable code (such as E1001) for lookup, for citation in issues, and for filtering by code in CI. The user-visible wording of a diagnostic (title / template / help) comes from locales/*.json; yx explain <code> prints it in the terminal.
Code Numbering
A code consists of a prefix (the family) and a four-digit sequence; the family names the compiler phase.
| Family prefix | Category | Meaning | Registered codes |
|---|---|---|---|
E0xxx | Lexer / Parser | Lexical and syntax analysis errors | 12 |
E1xxx | TypeCheck | Type-checking errors | 62 |
E2xxx | Semantic | Semantic analysis errors | 23 |
E3xxx | Codegen | Code generation errors (including IR consistency checks) | 14 |
E4xxx | Generic | Generic, trait, and constant evaluation errors | 15 |
E5xxx | Module | Module and import errors | 8 |
E6xxx | Runtime | Runtime errors (VM and std native functions) | 7 |
E7xxx | Io | I/O and system errors | 4 |
E8xxx | Internal | Internal compiler errors (defects in the compiler itself) | 3 |
W1xxx | Warning | Warnings (the W family emits at the warn level by default and does not block compilation; the exception is W1090, which emits at the error level and blocks compilation) | 12 |
The E3xxx family was not listed in any documentation before; it is now part of this page. Its codes are produced during IR generation and entry-point checks.
Statistics
- The
define_codes!registry holds 160 entries (148Ecodes and 12Wcodes). - std-layer runtime codes: 5 (not in the
define_codes!registry; see the next section). - 165 diagnostic codes in total.
- 32 of the registered codes have no emission site in non-test code and are marked "Not yet emitted"; their code numbers are retained, but users cannot trigger them yet.
Quick Reference by Code Prefix
| Family prefix | Category | Meaning | Details |
|---|---|---|---|
E0xxx | Lexer / Parser | Lexical and syntax analysis errors | Family page: E0xxx |
E1xxx | TypeCheck | Type-checking errors | Family page: E1xxx |
E2xxx | Semantic | Semantic analysis errors | Family page: E2xxx |
E4xxx | Generic | Generic and trait errors | Family page: E4xxx |
E5xxx | Module | Module and import errors | Family page: E5xxx |
E6xxx | Runtime | Runtime errors | Family page: E6xxx |
E7xxx | Io | I/O and system errors | Family page: E7xxx |
E8xxx | Internal | Internal compiler errors | Family page: E8xxx |
W1xxx | Warning | Warnings | W1xxx |
The E3xxx family has no page of its own; all of its codes are listed in the full inventory below.
Full Code Inventory
The "Template" column comes from locales/en.json and shows the diagnostic body with its parameters substituted; "Emission sites" counts the call sites of the code in non-test code.
| Code | Name | Category | span exempt | Template | Emission sites |
|---|---|---|---|---|---|
E0001 | Invalid character | Lexer | No | Invalid character: '{char}' | ✅ 1 site |
E0002 | Invalid number literal | Lexer | No | Invalid number literal: '{literal}' | ✅ 1 site |
E0003 | Unterminated string | Lexer | No | string started at line {line} is unterminated | ⚠ Not yet emitted |
E0004 | Invalid character literal | Lexer | No | invalid character literal: '{literal}' | ⚠ Not yet emitted |
E0010 | Expected token | Parser | No | expected {expected}, found {found} | ✅ 6 sites |
E0011 | Unexpected token | Parser | No | Unexpected token: '{token}' | ✅ 19 sites |
E0012 | Invalid syntax | Parser | No | Invalid syntax: {reason} | ✅ 14 sites |
E0013 | Mismatched brackets | Parser | No | Mismatched {bracket_type}: opened at line {open_line}, column {open_col}, not closed | ⚠ Not yet emitted |
E0014 | Missing semicolon | Parser | No | Missing semicolon after {statement} | ⚠ Not yet emitted |
E0016 | Expected expression | Parser | No | Expected expression: {context} | ✅ 4 sites |
E0018 | Keyword used as name | Parser | No | '{keyword}' is a keyword and cannot be used as a name | ✅ 1 site |
E0019 | Expression nesting too deep | Parser | No | expression nesting exceeds the maximum recursion depth ({limit}) | ✅ 1 site |
E1001 | Unknown variable | TypeCheck | No | Unknown variable: '{name}' | ✅ 6 sites |
E1002 | Type mismatch | TypeCheck | No | Expected type '{expected}', found type '{found}' | ✅ 77 sites |
E1003 | Unknown type | TypeCheck | No | Unknown type: '{type}' | ✅ 3 sites |
E1010 | Argument count mismatch | TypeCheck | No | function '{func}' expected {expected} arguments, found {found} | ✅ 19 sites |
E1011 | Implementation parameter annotation mismatch | TypeCheck | No | implementation parameter annotation mismatch: expected '{expected}', found '{found}' | ✅ 1 site |
E1012 | Return type mismatch | TypeCheck | No | return type mismatch: expected '{expected}', found '{found}' | ✅ 4 sites |
E1013 | Function not found | TypeCheck | No | Function not found: '{func}' | ✅ 3 sites |
E1014 | Unknown named argument | TypeCheck | No | Function '{func}' has no parameter named '{name}' (available: {params}) | ✅ 2 sites |
E1015 | Argument specified more than once | TypeCheck | No | Parameter '{name}' of function '{func}' was specified more than once | ✅ 1 site |
E1020 | Cannot infer type | TypeCheck | No | Cannot infer the type of '{expr}' | ⚠ Not yet emitted |
E1021 | Type inference conflict | TypeCheck | No | type inference conflict: {reason} | ⚠ Not yet emitted |
E1030 | Non-exhaustive patterns | TypeCheck | No | non-exhaustive patterns: missing {patterns} | ✅ 2 sites |
E1031 | Unreachable pattern | TypeCheck | No | unreachable pattern: '{pattern}' | ✅ 5 sites |
E1032 | Duplicate binding in pattern | TypeCheck | No | Duplicate pattern binding: '{name}' appears multiple times in the same pattern | ✅ 2 sites |
E1033 | Inconsistent bindings in or-pattern | TypeCheck | No | Inconsistent bindings in or-pattern: both sides of \|` must bind the same set of names` | ✅ 1 site |
E1034 | Missing field in struct pattern | TypeCheck | No | Struct pattern missing field '{field}' (all fields of '{struct}' must be fully covered) | ✅ 1 site |
E1040 | Operation not supported | TypeCheck | No | type '{type}' does not support operation '{op}' | ⚠ Not yet emitted |
E1041 | Index out of bounds | TypeCheck | No | index out of bounds: valid range is 0..{max}, found {index} | ✅ 5 sites |
E1042 | Field not found | TypeCheck | No | field '{field}' not found in struct '{struct}' | ✅ 10 sites |
E1043 | Module member not found | TypeCheck | No | Module '{module}' did not export '{name}' | ✅ 1 site |
E1050 | Boolean operand required | TypeCheck | No | Logical operation requires boolean operands, got '{left}' and '{right}' | ✅ 1 site |
E1051 | Logical NOT requires boolean operand | TypeCheck | No | Logical NOT requires boolean operand, got '{type}' | ✅ 1 site |
E1052 | Invalid dereference | TypeCheck | No | Cannot dereference type '{type}', expected pointer type | ✅ 1 site |
E1053 | Non-struct field access | TypeCheck | No | Cannot access field on non-struct type '{type}' | ✅ 2 sites |
E1054 | Condition type mismatch | TypeCheck | No | Condition must be a boolean type, got '{type}' | ✅ 4 sites |
E1055 | Constraint in non-generic context | TypeCheck | No | Constraint type '{type}' can only be used in a generic context | ⚠ Not yet emitted |
E1060 | Type parameter count mismatch | TypeCheck | No | expected {expected} type parameters, found {found} | ⚠ Not yet emitted |
E1061 | Cannot instantiate generic | TypeCheck | No | cannot instantiate generic type with given parameters | ⚠ Not yet emitted |
E1062 | Const generic constraint failed | TypeCheck | No | const generic constraint failed: \` does not hold` | ✅ 1 site |
E1064 | Invalid binding position index | TypeCheck | No | Invalid binding position index: {positions} (the function has {total} parameters) | ✅ 3 sites |
E1065 | Call of non-function value | TypeCheck | No | type \` is not callable — it is not a function` | ✅ 1 site |
E1071 | Type definitions only allowed at module level | TypeCheck | No | type definition '{name}' is only allowed at module level (module top level) | ✅ 2 sites |
E1081 | ? is only allowed in functions returning a propagatable type | TypeCheck | No | \?` is only allowed in functions returning a type that implements `Try`` | ✅ 2 sites |
E1082 | ? can only be used on types that implement Try | TypeCheck | No | '{type}' does not implement the \Try` interface, so `?` cannot be used` | ✅ 1 site |
E1083 | Error type mismatch for ? | TypeCheck | No | Error type mismatch for \?`: expected '{expected}', found '{found}'` | ✅ 1 site |
E1090 | ✨ Unspeakable ✨ | TypeCheck | No | Type: Type = Type | ⚠ Not yet emitted |
E1091 | Invalid generic meta type | TypeCheck | No | Generic meta type self-reference is not allowed: '{decl}' | ✅ 1 site |
E1092 | Invalid refinement type argument form | TypeCheck | No | '{name}' requires a compile-time constant argument, but the given argument cannot be converted | ✅ 10 sites |
E1093 | Refinement argument count mismatch | TypeCheck | No | '{name}' expected {expected} argument(s), found {found} | ✅ 2 sites |
E1094 | Unused compile-time value parameter | TypeCheck | No | '{param}' is declared as a compile-time value parameter of '{type}', but is not referenced in the type body | ✅ 1 site |
E1095 | Unknown interface | TypeCheck | No | Unknown interface: '{name}' (the name referenced by the type body is not a registered type constructor) | ✅ 1 site |
E1096 | Interface parameter count mismatch | TypeCheck | No | Interface '{name}' expected {expected} type parameters, found {found} | ✅ 3 sites |
E1097 | Interface member naming conflict | TypeCheck | No | Member '{member}' of type '{type}' conflicts with an interface member (fields and methods share a namespace, §1.2) | ✅ 1 site |
E1098 | Interface method not implemented | TypeCheck | No | type '{type}' does not implement method '{method}' of interface '{interface}' | ✅ 1 site |
E1099 | Interface method signature mismatch | TypeCheck | No | method '{method}' of type '{type}' does not match the interface signature: expected {expected}, found {found} | ✅ 2 sites |
E1100 | Duplicate interface method implementation | TypeCheck | No | method '{method}' of type '{type}' is implemented more than once (same-signature override is forbidden, §3) | ✅ 1 site |
E1101 | Type does not implement interface | TypeCheck | No | type '{type}' does not implement interface '{interface}' and cannot enter this existential type position | ✅ 5 sites |
E1102 | Loop control statement appears outside a loop | TypeCheck | No | '{keyword}' appears outside a loop | ✅ 2 sites |
E1103 | Square brackets cannot be used in type position | TypeCheck | Yes | '{name}[...]' is not type syntax—type arguments require parentheses | ✅ 1 site |
E1104 | Interface implementation is not in the type's defining module | TypeCheck | No | Type '{type}' is not defined by this module; interface '{interface}' cannot be implemented for it in this module | ✅ 1 site |
E1105 | Variant constructor cannot be used as field access | TypeCheck | No | '{variant}' is a variant constructor of the sum type '{type}', not a data field | ✅ 1 site |
E1106 | Constrained method dispatch failed | TypeCheck | No | Constrained method dispatch failed: \`—{detail}` | ✅ 1 site |
E1107 | Method overload ambiguity | TypeCheck | No | Method overload ambiguity: '{key}' has {count} candidate matches that cannot be distinguished | ✅ 1 site |
E1108 | Empty block in container expected position | TypeCheck | Yes | A container type is expected here, but \{}` is an empty block (value Void)` | ✅ 2 sites |
E1109 | Return appears outside a function | TypeCheck | No | 'return' appears outside a function | ✅ 3 sites |
E1110 | Method binding missing signature annotation | TypeCheck | No | '{type}.{method}' is missing a signature annotation | ✅ 1 site |
E1111 | Argument duplicate or invalid order | TypeCheck | No | function '{func}' parameter '{name}' received multiple arguments (or argument order is invalid) | ✅ 2 sites |
E1112 | Implementation declares more parameters than the signature | TypeCheck | No | The annotation for function '{name}' provides only {expected} runtime parameter slots, but the implementation header specifies {found} parameters; the extra one has no value to bind to. | ✅ 1 site |
E1113 | Compile-time value parameter lacks compile-time evidence | TypeCheck | No | Compile-time value parameter '{param}' requires compile-time evidence, but the argument cannot be determined at compile time | ✅ 1 site |
E1114 | Witness field is not readable at value level | TypeCheck | No | Witness field '{field}' is compile-time evidence of record '{type}' and has no runtime data slot; it cannot be read at value level | ✅ 3 sites |
E1115 | Witness-bearing record is immutable | TypeCheck | No | Record '{type}' carries a witness field, so all of its fields must stay unchanged after construction | ✅ 4 sites |
E1116 | Bare name collides with exports of multiple standard library units | TypeCheck | No | '{name}' is exported by multiple standard library units ({units}); a bare name cannot determine the call target | ✅ 1 site |
E2001 | Scope error | Semantic | No | Variable '{name}' is not in scope | ⚠ Not yet emitted |
E2002 | Duplicate definition | Semantic | No | redefinition: '{name}' is already defined in the current scope | ✅ 4 sites |
E2003 | Ownership error | Semantic | No | ownership constraint violated: {reason} | ✅ 1 site |
E2010 | Immutable assignment | Semantic | No | cannot assign to immutable variable '{name}' | ✅ 2 sites |
E2011 | Use of uninitialized variable | Semantic | No | use of uninitialized variable '{name}' | ⚠ Not yet emitted |
E2012 | Mutability Conflict | Semantic | No | Mutability conflict: cannot use mutable reference in immutable context | ⚠ Not yet emitted |
E2013 | Variable Shadowing | Semantic | No | Cannot shadow existing variable '{name}' | ✅ 3 sites |
E2014 | Use of moved value | Semantic | No | '{name}' has been moved and cannot be used again | ✅ 1 site |
E2016 | Immutable assignment | Semantic | No | Cannot assign to immutable variable '{name}' | ✅ 1 site |
E2018 | Mutable/immutable borrow conflict | Semantic | No | Cannot mutable borrow '{name}' (already immutably borrowed) | ✅ 1 site |
E2019 | Double free | Semantic | No | Value '{name}' was freed twice | ✅ 1 site |
E2020 | Use after free | Semantic | No | '{name}' is used after being freed | ✅ 1 site |
E2027 | Unsafe dereference | Semantic | No | Cannot dereference a raw pointer outside of an unsafe block | ✅ 1 site |
E2090 | Invalid Signature | Semantic | No | Invalid signature: {reason} | ✅ 3 sites |
E2091 | Unknown Type in Signature | Semantic | No | Invalid signature: unknown type '{type_name}' | ⚠ Not yet emitted |
E2092 | Signature Missing Arrow | Semantic | No | Invalid signature: missing '->' | ✅ 1 site |
E2093 | Duplicate Parameter Name | Semantic | No | Invalid signature: duplicate parameter name '{name}' | ✅ 2 sites |
E2094 | Generic Parameter Shadowing | Semantic | No | Invalid signature: generic parameter '{name}' shadows an outer generic parameter | ⚠ Not yet emitted |
E2095 | Parameter name shadows generic parameter | Semantic | No | Invalid signature: parameter name '{name}' shadows a generic parameter | ✅ 1 site |
E2096 | Bare container type in signature | Semantic | No | Invalid signature: container type '{name}' is missing type arguments | ✅ 1 site |
E2029 | Reference cycle in spawn | Semantic | No | Reference cycle in spawn: {cycle} | ✅ 1 site |
E2030 | Refinement type constraint violation | Semantic | No | After assigning to '{assigned}', '{var}' no longer satisfies the refinement type constraint: {constraint} (counterexample: {counterexample}) | ✅ 1 site |
E2031 | Refinement constraint cannot be proven | Semantic | No | After assigning to '{assigned}', the refinement type constraint on '{var}': {constraint} cannot be statically proven within the proof kernel | ✅ 3 sites |
E3004 | Unsupported iterator | Codegen | No | Unsupported iterator type: {iter_type} | ✅ 2 sites |
E3005 | IR generation error | Codegen | No | IR generation error: {message} | ✅ 25 sites |
E3006 | Unresolved variable | Codegen | No | IR generation internal error: variable '{name}' could not be resolved | ✅ 1 site |
E3007 | Top-level binding initialization must be a constant | Codegen | No | The initialization of top-level binding '{name}' must be a compile-time constant expression | ⚠ Not yet emitted |
E3008 | Unsupported match pattern | Codegen | No | match pattern '{pattern}' is not yet implemented: currently only literal and wildcard (_) patterns are supported | ✅ 3 sites |
E3018 | Monomorphization instantiation failed | Codegen | No | Generic '{func}' instantiation failed: {reason} | ✅ 3 sites |
E3014 | Register overflow | Codegen | Yes | Register overflow: {id} exceeds limit {limit} | ✅ 4 sites |
E3017 | Invalid operand (code generation) | Codegen | No | Code generation: invalid operand: {reason} | ✅ 4 sites |
E3019 | Top-level binding cyclic dependency | Codegen | No | Top-level binding initialization forms a cyclic dependency: {cycle} | ✅ 1 site |
E3020 | Missing program entry | Codegen | No | Executable is missing the main binding ({path}) | ✅ 2 sites |
E3021 | Entry is not a function | Codegen | No | Program entry '{name}' must be a function, but it is a value binding | ⚠ Not yet emitted |
E3022 | Entry main signature mismatch | Codegen | No | Entry '{name}' signature mismatch: the runtime calls it with zero arguments, but it requires '{expected}', found '{found}' | ✅ 1 site |
E3023 | Top-level executable statements are not allowed | Codegen | Yes | Top-level executable statements are not allowed under the Bin role (yaoxiang.toml exists)—the program body is main | ✅ 1 site |
E3024 | Project config is unreadable | Codegen | Yes | Project config {path} is unreadable: {detail} | ✅ 1 site |
E4001 | Generic constraint violation | Generic | No | type '{type}' does not satisfy trait constraint '{trait}' | ✅ 1 site |
E4002 | Trait not found | Generic | No | trait '{trait}' not found | ⚠ Not yet emitted |
E4003 | Trait implementation missing | Generic | No | type '{type}' is missing implementation for trait '{trait}' | ⚠ Not yet emitted |
E4004 | Conflicting trait implementations | Generic | No | Conflicting implementations for trait '{trait}' | ⚠ Not yet emitted |
E4005 | Associated type not found | Generic | No | Associated type '{assoc_type}' not found in '{container}' | ⚠ Not yet emitted |
E4010 | Constant division by zero | Generic | No | Division by zero in constant expression | ✅ 3 sites |
E4011 | Constant overflow | Generic | No | Constant expression overflow | ✅ 5 sites |
E4012 | Constant recursion too deep | Generic | No | Constant evaluation exceeds the maximum recursion depth {limit} | ✅ 1 site |
E4014 | Constant evaluation failed | Generic | Yes | Unable to evaluate constant expression: {reason} | ✅ 11 sites |
E4018 | Refinement predicate violation | Generic | Yes | Refinement predicate violated: {constraint}{counterexample} | ✅ 6 sites |
E4019 | Type equality does not hold | Generic | No | Type equality does not hold: expected {expected}, found {found} | ✅ 1 site |
E4020 | Proof function required | Generic | No | A proof function is required to verify the constraint | ✅ 2 sites |
E4021 | Loop termination cannot be automatically proven | Generic | No | Loop termination cannot be automatically proven: no valid decreasing metric was found | ✅ 1 site |
E4022 | Measure does not hold | Generic | No | Measure does not hold: this call site cannot prove that the measure strictly decreases Counterexample: {counterexample} | ✅ 1 site |
E4023 | Cannot be proven within the kernel | Generic | No | Cannot prove: {proposition} ({reason}) | ✅ 1 site |
E5001 | Module not found | Module | No | Module '{module}' not found | ✅ 1 site |
E5002 | Import error | Module | No | Failed to import module '{module}': {reason} | ✅ 1 site |
E5003 | Export not found | Module | No | export '{export}' not found in module '{module}' | ✅ 1 site |
E5004 | Circular dependency | Module | No | circular dependency detected: {path} | ⚠ Not yet emitted |
E5005 | Invalid module path | Module | No | Invalid module path: '{path}' | ⚠ Not yet emitted |
E5006 | Duplicate import | Module | No | Duplicate import: '{name}' has already been imported | ✅ 1 site |
E5007 | Module exports | Module | No | Exports of module '{module}': {available} | ⚠ Not yet emitted |
E5008 | Import name conflict | Module | No | Import name '{name}' conflicts with an existing binding (imported from '{module}') | ✅ 1 site |
E6001 | Division by zero | Runtime | Yes | expression {expr} divides by zero | ✅ 5 sites |
E6003 | Array index out of bounds | Runtime | Yes | array index out of bounds: valid range is 0..{max}, found {index} | ✅ 3 sites |
E6004 | Stack overflow | Runtime | Yes | stack overflow: recursion depth exceeded limit {limit} | ✅ 3 sites |
E6005 | Assertion failed | Runtime | Yes | assertion failed: {condition} | ✅ 3 sites |
E6006 | Function not found (runtime) | Runtime | Yes | Function not found: '{func}' | ✅ 1 site |
E6007 | Runtime error | Runtime | Yes | Runtime error: {message} | ✅ 3 sites |
E6008 | Key not found | Runtime | Yes | key not found: {key} | ✅ 2 sites |
E7001 | File not found | Io | No | file not found: '{path}' | ⚠ Not yet emitted |
E7002 | Permission denied | Io | No | permission denied: '{path}' | ⚠ Not yet emitted |
E7003 | I/O error | Io | No | I/O error: {reason} | ⚠ Not yet emitted |
E7004 | Network error | Io | No | Network error: {reason} | ⚠ Not yet emitted |
E8001 | Internal compiler error | Internal | Yes | Internal compiler error: {message} | ✅ 16 sites |
E8002 | Unexpected Panic | Internal | No | Unexpected compiler panic: {reason} | ⚠ Not yet emitted |
E8003 | Compiler phase error | Internal | No | Compiler phase error: {phase} - {message} | ⚠ Not yet emitted |
W1001 | Unused private function | Warning | No | unused function: '{name}' | ✅ 1 site |
W1002 | Unused private type | Warning | No | unused type: '{name}' | ✅ 1 site |
W1003 | Unused import | Warning | No | unused import: '{name}' | ✅ 1 site |
W1004 | Unused private variable | Warning | No | unused variable: '{name}' | ✅ 1 site |
W1005 | Unused private method | Warning | No | Unused method: '{name}' | ✅ 1 site |
W1006 | Local module shadows dependency package | Warning | No | local module '{module}' shadows dependency package '{dependency}' | ✅ 2 sites |
W1007 | Module import cycle | Warning | No | Module import cycle {cycle}: initialization order within the cycle cannot be determined; the order within the cycle follows a deterministic convention based only on lexicographic path order (not a semantic guarantee) | ✅ 1 site |
W1063 | Const generic constraint cannot be evaluated | Warning | No | const generic constraint cannot be evaluated: \`` | ✅ 1 site |
W1081 | Termination obligation undecided | Warning | No | {count} termination measure obligation(s) undecided (SMT solver unavailable) | ✅ 1 site |
W1080 | Compile-time proof downgraded | Warning | No | The constraint cannot be proven at compile-time; downgraded to a runtime check | ⚠ Not yet emitted |
W1082 | Ownership analysis degraded | Warning | No | ownership analysis degraded: this compilation has no body checker (type ledger and call-ownership table missing), so ownership was judged against an empty ledger and borrow conflicts were not checked | ✅ 1 site |
W1090 | Obligation produced but never consumed | Warning | Yes | obligation field \` was produced in {file} but never consumed: {detail}` | ✅ 2 sites |
std-Layer Runtime Codes
The codes below are not in the define_codes! registry: standard library native functions construct them at run time through error_new("CODE", …), so they never appear in the result of ErrorCodeDefinition::find(). locales/*.json still carries wording for them, so users may still see them in the terminal.
| Code | Name | Category | Template | Emission sites |
|---|---|---|---|---|
E6009 | Invalid Range step | std runtime | Invalid Range step: step = {step} | src/std/range.rs:213, src/std/range.rs:344 and 3 more sites |
E6010 | Integer parsing failed | std runtime | Integer parsing failed: {input} | src/std/result.rs:31, src/std/string.rs:958 |
E6011 | Floating-point parsing failed | std runtime | Floating-point parsing failed: {input} | src/std/result.rs:32, src/std/string.rs:983 and 3 more sites |
E6012 | Invalid code point | std runtime | Illegal code point: {input} | src/std/result.rs:33, src/std/string.rs:1028 |
E6013 | JSON parse failed | std runtime | JSON parse failed: {detail} | src/std/json.yx:485, src/std/result.rs:34 |
Notation
- span exempt: when it is
true, the diagnostic may carry no source location (internal errors, runtime diagnostics, and the like). A non-exempt code is rejected when it has neither an explicit.at()nor a walk context (panic in debug builds,E8001in release builds). - Emission site ⚠ Not yet emitted: the code is retained in the registry, but non-test code never calls it, so users cannot trigger it. Code numbers are never recycled, so a diagnostic in an old artifact is never reused for a different meaning.
- std-layer runtime codes: see the previous section; they are not counted in the registry statistics.
Look Up a Single Code
yx explain E1001
yx explain E1001 --jsonQuerying from Rust
use yaoxiang::util::diagnostic::{ErrorCodeDefinition, I18nRegistry};
let i18n = I18nRegistry::default();
if let Some(code) = ErrorCodeDefinition::find("E1001") {
println!("Title: {}", i18n.get_title(&code));
if let Some(help) = i18n.get_help(&code) {
println!("Help: {}", help);
}
}