Skip to content

Diagnostic Reference

Every error, warning, and lint the Zolo toolchain emits. Click a code to see the full explanation, the typical cause, and the recommended fix.

14 / 68 with full explainers

Lint · 24

float-equality Comparing floats with `==` or `!=`

Floating-point equality is imprecise. Use `~=` (adaptive tolerance), `!~=`, or `math.approx_eq_abs/_rel(...)`. For exact comparisons use the `decimal` type.

unused-variable Unused variable

A `let`-bound variable or parameter is never read. Prefix the name with `_` to silence the lint intentionally.

unused-function Unused function

A top-level function is never called and is not marked `pub`, `@test`, `@bench`, `@export`, an HTTP route, or `main`.

unused-import Unused import summary only

An imported name is never referenced in the file.

shadowed-variable Variable shadows outer binding summary only

A `let` re-binds a name from an outer scope. Shadowing is sometimes intentional; rename one binding to silence the warning.

dead-code Dead code after terminal statement summary only

Code after `return`, `break`, or `continue` is unreachable.

naming-convention Naming convention violation

Functions/variables use `snake_case`; structs/enums/traits/effects use `PascalCase`.

must-use `@must_use` value discarded summary only

A function or type annotated `@must_use` returned a value that the caller discarded. Bind it (`let _ = ...`) or consume it.

deprecated Use of deprecated item summary only

A function annotated `@deprecated` was called. The annotation's message explains the replacement.

infinite-loop Infinite loop with no exit summary only

A `loop`/`while true` block has no reachable `break`/`return`.

optional-typo Likely typo on optional access summary only

A `Some(...)` / `None` / `?.` / `??` use that looks like a typo or misuse of the optional API.

non-exhaustive-match Non-exhaustive `match`

A `match` over an enum does not cover every variant and has no wildcard `_` arm.

unreachable-pattern Unreachable `match` arm summary only

A pattern can never match because an earlier arm already covers it.

max-line-length Line exceeds configured maximum length summary only

Configured via the project's lint config. Default is permissive; tighten in CI if you want hard limits.

max-nesting-depth Block nested deeper than allowed summary only

Deep nesting hurts readability. Extract helpers or use early-return guard clauses.

max-parameters Function has too many parameters summary only

Long parameter lists are a code-smell. Consider grouping related parameters into a struct.

max-function-length Function body exceeds configured length summary only

Break the function into smaller helpers.

unknown-repr Unknown `@repr(...)` policy summary only

Only `@repr(C)`, `@repr(packed)`, `@repr(transparent)`, and `@repr(zolo)` are recognized.

transparent-multi-field `@repr(transparent)` on multi-field struct summary only

`transparent` only applies to single-field newtype-style structs.

layout-in-default-repr `@layout(...)` on default-repr struct summary only

`@layout` only takes effect alongside an explicit `@repr`.

align-not-positive `@layout(align = ...)` must be positive summary only

Alignment must be a positive power of two.

align-not-power-of-two `@layout(align = ...)` must be a power of two summary only

Hardware alignment rules require power-of-two values (1, 2, 4, 8, ...).

align-too-large `@layout(align = ...)` value too large summary only

The requested alignment exceeds the maximum the target platform supports.

size-not-positive `@layout(size = ...)` must be positive summary only

Size cannot be zero or negative.

Parse · 4

Type · 32

E0001 Type mismatch (legacy) summary only

Equivalent to `TE001`. Emitted by the legacy message-pattern classifier when the new typeck did not attach a code.

E0002 Undefined variable (legacy) summary only

Legacy alias for `TE100`.

E0003 Undefined function / not callable (legacy) summary only

Legacy alias for `TE101`.

E0004 Cannot reassign (legacy) summary only

Legacy alias for `TE004`. The variable was declared with `let`; use `let mut` to allow reassignment.

E0005 Undefined field (legacy) summary only

Legacy alias for `TE102`.

E0006 Missing field summary only

A struct literal omits one or more required fields.

E0007 Wrong number of arguments (legacy) summary only

Legacy alias for `TE110`.

E0008 Return type mismatch summary only

The value being returned does not match the function's declared return type.

E0009 Duplicate declaration summary only

A name (function, variable, field, variant) was declared twice in the same scope.

E0010 Unknown type summary only

A type annotation refers to a type that the compiler cannot find.

TE001 `let` type mismatch

The value assigned to a `let` binding does not satisfy the declared type annotation.

TE002 `const` type mismatch summary only

The value assigned to a `const` binding does not satisfy the declared type annotation.

TE003 `const` value not a compile-time constant summary only

`const` requires a constant-foldable expression. Use `let` for runtime values.

TE004 Cannot reassign immutable binding

`let` bindings are immutable by default. Use `let mut x = ...` to allow reassignment, or use a fresh `let` shadow.

TE005 Compound assignment on non-numeric summary only

Operators like `+=`, `-=`, `*=` require both sides to be numeric (or strings for `+=`).

TE006 Multi-return arity mismatch (too few) summary only

The function declared a tuple return but the actual `return` statement provides fewer values.

TE007 Multi-return arity mismatch (too many) summary only

The function returns more values than its declared single-value return type can hold.

TE008 Array element type mismatch summary only

An array literal mixes incompatible element types; arrays are homogeneous.

TE009 Arithmetic on incompatible types summary only

Binary arithmetic requires both operands to be numeric and (in strict mode) the same numeric type.

TE100 Undefined variable

The name is not declared in any enclosing scope. The compiler attaches a "did you mean?" suggestion when a similar name exists.

TE101 Calling a non-function value summary only

The callee in a function-call expression is not a callable type.

TE102 Struct has no such field summary only

The struct does not declare this field. "Did you mean?" suggestions are attached for near-matches.

TE103 Unknown type name summary only

A type annotation or enum-variant field references a type the compiler cannot resolve.

TE104 No such method

The receiver type does not have a method with this name. Check spelling, imports, and trait visibility.

TE110 Method call arity mismatch

The number of arguments passed does not match the function's parameter count.

TE111 Method call argument type mismatch

An argument's type does not match the corresponding parameter's declared type.

TE201 Strict mode: variable needs annotation summary only

Strict typing requires every `let`/`const` to have an explicit type annotation.

TE202 Strict mode: parameter needs annotation summary only

Strict typing requires every function parameter to have an explicit type.

TE301 Generic type argument count mismatch summary only

The number of type arguments supplied does not match the generic's declared parameter count.

TE302 Unknown trait summary only

A trait bound, `impl` block, or `where` clause references a trait the compiler cannot find.

TE826 Collection method on un-unwrapped `Result`/`Option`

A collection method (`each`, `filter`, `len`, …) was called on a `Result` or `Option` wrapper directly. Unwrap it first with `?>`, `?`, or `.unwrap()`.

TE827 `?.` null-safe chain on `Result`/`Option`

`?.` is null-safe chaining, not fallible unwrapping. A `Result` or `Option` is never `nil`, so the chain runs over the wrapper itself. Use `expr ?> .m(...)`, `let v = expr?`, or `expr!.m(...)` instead.

Effects · 7

Runtime · 1

enespt-br