Error codes

Diagnostics carry a stable ErrorCode (shown as E#### in pretty output, SARIF ruleId, and LSP code). Codes are grouped by family:

RangeFamily
E00xxParse / syntax
E01xxName resolution & types
E02xxEnums, match, constructs
E03xxFormat strings & builtins
E04xxAggregates, records, FFI tags
E08xxCodegen
E09xxCLI / I/O / archive

Catalog#

CodeNameMeaning
E0001ParseErrorSyntax / parse error
E0200DuplicateEnumTwo enum declarations with the same name in one scope, or a class / enum that redeclares a built-in type (Option, Result, Vec, Range, Weak, a primitive in any letter case such as String, a built-in error enum such as IoError, …)
E0201DuplicateConstructorDuplicate variant on one enum, or a bare constructor when two in-scope enums share that case name (Ambiguous constructor). Write Status::Ok / Result::Ok(…)
E0208DuplicateFieldDuplicate record field (parse-time for literals, constructors, patterns, and enum variant field decls; typecheck keeps the same code if parse is bypassed). Also duplicate named arguments.
E0100UnknownValueCannot find value in this scope
E0101UnknownFunctionCannot find function
E0102TypeMismatchType mismatch
E0103InfiniteTypeInfinite type (occurs check)
E0104NotAFunctionValue is not callable
E0105TooManyArgumentsToo many arguments in a call that uses named arguments. A positional call with too many arguments reports E0119
E0106UndeclaredAssignmentAssignment to undeclared variable
E0107InvalidAssignmentInvalid assignment target (includes removed arr[] = append — use Vec::push); a write through a readonly value, or a call that passes one where the callee mutates it
E0108VariableRedeclarationVariable redeclaration
E0109ConstantRedeclarationConstant redeclaration
E0110UnknownTypeUnknown type name
E0111ReturnMismatchReturn type mismatch
E0112YieldOutsideAsyncyield outside gen fn
E0113ResumeTypeMismatchReserved; not emitted today. A resume h with v whose v does not match the send type reports E0102
E0114InvalidTry? on non-Option/non-Result, or outside a function
E0115InvalidCoalesce?? on non-Option/non-Result
E0116InvalidOptionalAccess?. on non-Option (e.g. Result)
E0117ConflictingErrorTypeMixed Option/Result modes in one function. A conflicting E (raise "s" then raise 1, or ? on a Result with another E) reports E0102
E0118UnreachableCodeCode after a diverging statement (warning)
E0119GenericTypeErrorOther type error (includes rejected dynamic [T] — use [T; N] or Vec<T>)
E0120–E0122Overload familyWrong arity / duplicate / ambiguous overload
E0123DeferNeverRunsdefer never runs on function exit (warning)
E0124WildcardImportuse path::* is banned (virtual and userland) — list names explicitly; prelude is auto-injected
E0125ExpressionNestingTooDeepA single expression recursed past the compiler’s internal depth limit during typecheck or codegen (not the compiled program’s own call stack, which the VM grows at run time)
E0126InvalidDropInvalid fn drop(self) (not an inherent class or enum method, on a scalar-backed enum, static, extra args, duplicate, non-unit return, or on a readonly class)
E0127UnsupportedGenericFnValueA generic fn with a type parameter nested in its signature (Vec<T>, Option<T>, tuples, classes) used as a value where no specialized copy can stand in for it, such as copying it on (let g = wrap; let k = g;). A let binding only called (let g = wrap; g(2.5)) or passing it to a parameter of a concrete function type works. Otherwise call it directly or wrap it in a lambda at a concrete type. Also a generic fn whose result is a type parameter, held as a polymorphic value and called with more arguments than it declares (let f = id; f(add, 1, 2)): call it by name with every argument
E0128PrivateMemberPrivate field or inherent method used outside the type’s impl
E0129DeprecatedWarning: call to a deprecated function (io::drive, io::wait_ready) or the deprecated static const spelling (write const). The help names the replacement
E0130ByteWrapWarning: byte + - * ** << or unary -, whose result wraps modulo 256. Convert to int first (x as int) for exact arithmetic
E0131ShiftCountOutOfRangeA constant shift count (x << 64, x >> -1, or the compound <<= / >>=) outside 0..=63. A run-time count out of range panics with shift count out of range
E0132UnassignedLocalA type-only let x: T; of a non-scalar type read where it may not have been assigned yet (one branch only, only inside a loop body, or captured before the assignment)
E0133DuplicateImportTwo use imports bind the same local name to different items (use math::{add, mul as add};)
E0134ConstNotComputableA const or comptime could not be computed while compiling: its initializer has an effect the build did not grant, a granted call was refused, it panicked or ran into a --comptime-* limit, or a comptime value holds something that exists only at run time (a function, a stream; a const like that runs at startup instead). See Compile-time code
E0135ComptimeResultChangedInfo: --comptime-refresh computed a different result than the one in the compile-time result cache
E0136UnusedResultWarning: an expression statement drops a Result (Err("bad");, or f(x); where f returns one), and with it any error it holds. Handle it with ? or match, or discard it on purpose with let _ = f(x);. f(x)?;, an assignment (x = r;) and a block’s tail value do not warn. Inside a test("…") { … } body it is an error, since a dropped Result there (an assert! helper called as helper();) would hide a failed assert: write helper()?; to fail the test, or let _ = helper();. A fn or lambda written inside a test body keeps the warning
E0138ComptimeFoldBudgetInfo: at -O2 and above, a pure call with constant arguments (fib(32)) ran longer than automatic compile-time folding allows, so it stays a call. Write comptime fib(32) (or bind it to a const) to compute it while compiling; that makes compilation take longer, and the help says how long the call ran before it was stopped
E0200–E0216Enum / match familyDuplicate enum, ambiguous / duplicate constructor, unknown variant, non-exhaustive match, scalar #[repr], default catch-all, …
E0213InvalidEnumReprInvalid scalar enum (#[repr] / =): mixed backing, missing =, or = mixed with a payload
E0214DuplicateEnumDiscriminantTwo scalar cases share the same backing value
E0215MultipleMatchCatchallMore than one default arm in a match
E0216UnderscoreMatchArmWhole-arm _ => — catch-all is default only. Nested _ (Err(_), Some(_)) is allowed
E0300–E0301Format familySpecifier / arity mismatch
E0400–E0405Aggregate / FFI familyIndex OOB, array element mismatch, declare/invoke arity, …
E0406–E0408HostExecDenied / HostExitDenied / HostAttachDeniedenv::exec, env::exit or Stream.attach reached without --allow-exec / --allow-exit / --allow-attach; see Permissions
E0409–E0411HostFfiExecDenied / HostDloadDenied / HostDloadNonConstAn FFI process-exec symbol without --allow-ffi-exec, dload of a stem without --allow-dload (or a libc alias), or a non-literal dload path
E0412FixedArrayGrowLength-changing method (push / insert / …) on a fixed [T; N]
E0413EffectMismatchA function’s effects exceed its pure fn / uses {…}, or its trait method’s, or a contract clause has an effect. The message names the call chain; see Effects and Contracts
E0414HostCapDeniedA host call main or a test reaches needs read, write, net or env and the build did not grant it. The message names the flag and the call chain; see Permissions
E0800–E0801Codegen familyUnknown expression / codegen error
E0802–E0803UnboundedRecursion / StackDepthExceededRetired: no longer emitted (the VM grows its stack and checks depth at run time)
E0804MonomorphizeCapThe per-function or total monomorphization cap was hit; extra specializations were not emitted
E0805ParLockHintAuto-parallelization refused a loop because of a shared escape; the hint suggests locking that resource
E0900IoErrorI/O failure
E0901ArchiveVersionMismatchStale .hyc archive
E0902InvalidCliFlagsConflicting or unknown CLI flags
E0903MissingInputFileNo input file given

CLI output modes#

FlagFormatStream
(default)Pretty (ariadne)stderr
--log-jsonSARIF 2.1stdout
--log-lspLSP Diagnostic NDJSONstdout

--log-json and --log-lsp are mutually exclusive.

↑ ↓ navigate ↵ open