Lowent Manual←↑→

Appendix B — Diagnostics index

The first two tables list the diagnostics this book’s examples actually trigger. Diagnostics you can meet but the examples do not show are gathered at the end under “Other diagnostics”. A code keeps its meaning across releases; the compiler explains the details and the repair at the site (--diag-json in a machine-readable form).

At translation time#

CodeMeaningShown in
E-ACCESS-MODEthe body breaks the read or write promise made with accesschapter 27
E-ACTOR-FIELDan actor’s state field is read from outsidechapter 25
E-ACTOR-STATE-REFa borrow is kept in an actor state fieldchapter 25
E-ACTOR-UNINITa just-spawned actor’s slice state field is read before it is setchapter 20
E-ALLOC-AMBIGUOUSmore than one fitting allocator and none chosen with usingchapter 20
E-ALLOC-NESTEDallocated from an outer source while an inner region of the same root is openchapter 18
E-ALLOC-NOCAPdeclares alloc but receives no allocation capabilitychapter 16
E-ALLOC-NOSOURCEa call draws from an allocator but no fitting one is visible in this opchapter 20
E-ALLOC-OUTLIVESregion bytes handed to an actor born outside the regionchapter 18
E-ALLOC-SHAREDan allocator whose cursor is not atomic is handed to a taskchapter 26
E-ALLOC-TASKan op that carves from a root is spawned as a taskchapter 26
E-ALLOC-USING-UNUSEDusing on a call that does not draw from an allocatorchapter 20, chapter 34
E-ASM-TARGET-UNKNOWNthe machine name in an asm clause is not a known targetchapter 30
E-ASM-UNBOUNDthe assembly template names an undeclared operandchapter 30
E-ATOMIC-NOCAPdeclares atomic but receives no cap atomicchapter 27
E-ATOMIC-ORDERa memory ordering that has no meaning for that atomic operationchapter 27
E-BLOCK-UNCLOSEDa block opened with do is never closed with endchapter 2
E-BOUND-UNSATthe type argument does not satisfy the required traitchapter 22, chapter 23
E-BRAND-REUSEDa brand opens a second storagechapter 35
E-CAP-FORGEspawns an actor holding a capability without holding that capabilitychapter 16, chapter 20, chapter 25
E-CAP-KINDa capability of the wrong kind was handed overchapter 16
E-CAP-LOCALa received capability was copied into a local namechapter 16
E-CAP-MISSINGa capability-requiring builtin was not given its capability as the first operandchapter 16
E-CHARa character (symbol) this language does not havechapter 6, chapter 7, chapter 8, chapter 9
E-CHAR-WIDTHa character literal is not a single characterchapter 3
E-CLAUSE-ORDERthe clauses of an op header are out of the fixed orderchapter 2, chapter 3, chapter 22
E-COMPTIME-ARGa run-time value in a comptime positionchapter 22
E-CONC-ALONEa task group spawns one task that waits for a peerchapter 26
E-CONC-DEADLOCKevery task in the group receives and none sendschapter 26
E-CONFIG-TYPEthe configuration gives a value the option does not offerchapter 31
E-CONFIG-UNDEFa configuration or config names an undeclared build optionchapter 31
E-CONTRACT-DEADdeclares an error that requires already excludeschapter 14
E-CONTRACT-IMPOSSIBLEa call with constant arguments breaks the callee’s requireschapter 14, chapter 35
E-CONTRACT-UNSATtwo preconditions that cannot both holdchapter 14
E-DEP-MISSINGthe file at a use … from place cannot be readchapter 21
E-EFFECTperforms an effect its effects clause does not declarechapter 15, chapter 20, chapter 26
E-EFFECT-CALCa pure fn performs an effectchapter 1, chapter 5, chapter 15, chapter 16, chapter 18, chapter 24
E-EFFECT-DUPthe same atom twice in an effects clausechapter 15, chapter 44
E-EFFECT-NO-CAPdeclares io (or similar) without a capability that authorises itchapter 2, chapter 16
E-EFFECT-NONE-MIXnone written together with a real effectchapter 15
E-EFFECT-PURITYa fn writes state visible to its caller or actorchapter 5, chapter 15, chapter 25
E-EFFECT-REDUNDANTeffects none written on a fnchapter 5
E-EFFECT-UNDEFan effect word outside the closed vocabularychapter 15, chapter 44
E-ENS-UNDEFensures names something undefined — the returned value is retchapter 14
E-ENTRY-PARAMSthe entry point takes a non-capability inputchapter 16
E-ENUM-DOTan enum variant not closed with .chapter 10
E-ENUM-INFINITEa variant embeds its own type by valuechapter 10
E-ERR-UNDECLAREDreturns an error not in its errors clausechapter 11
E-ERRORS-STATEan errors condition reads an actor state fieldchapter 25
E-ESCAPEa reference to a local escapes the opchapter 12
E-EXCLoverlapping borrows or owner access to the same valuechapter 12, chapter 20, chapter 26, chapter 43
E-EXPR-APPa call inside an expr island is not parenthesisedchapter 8
E-EXPR-CHAINcomparisons chained in an expr islandchapter 3
E-EXPR-UNARYa unary operator in an expr islandchapter 8
E-FFI-LINKan extern op does not name the C symbol it callschapter 29
E-FFI-NOCAPcalls C without receiving cap cchapter 29
E-FFI-NOEFFECTan op calling C declares no effectchapter 29
E-FFI-NOUNSAFEcalls C without the unsafe markchapter 29
E-FFI-TYPEa type the C ABI cannot express crosses the boundarychapter 29
E-FIELD-GLUEDtried to read a field by gluing a dot to a value — write fieldchapter 3
E-FN-CAPan op to be passed as a callback requires a capabilitychapter 29
E-FN-NOTEXPORTunsafe_fn names an op that is not export externchapter 29
E-FOLD-OPa pipe stage names an op that does not existchapter 24
E-FOLD-ORDERa fold stage op declares its accumulator with a type other than its resultchapter 24
E-GROUP-UNCLOSEDan unclosed parenthesischapter 3
E-GUARD-FALLTHROUGHthe else of a guard does not leavechapter 7
E-HEAP-NOHOSTasks for the growing root on a freestanding targetchapter 18
E-IF-VALUEif used as a valuechapter 6
E-IMMUTABLEset on a name bound with letchapter 6
E-IR-ARITYan op is called with the wrong number of argumentschapter 5, chapter 48
E-IR-UNDEFa name unknown at that placechapter 6, chapter 7, chapter 21, chapter 22, chapter 25
E-ISR-CALLEDan interrupt handler called from codechapter 30
E-ISR-EFFECTan interrupt handler does not declare effects devicechapter 30
E-ISR-PARAMSan interrupt handler takes parameterschapter 30
E-LET-NOVALUEnothing after bechapter 6
E-LOCK-NOTYETshared lock types are not built yetchapter 26
E-MATCH-INEXHAUSTIVEa match does not cover every casechapter 7, chapter 10
E-MATCH-REDUNDANTa match arm can never run (an arm after _, overlapping ranges)chapter 11
E-METHOD-RECVan attached op’s receiver is not its first inputchapter 23
E-METHOD-UNDEFno op of that name is attached to the receiver’s typechapter 22, chapter 23
E-MMIO-BYVALUEan mmio register block taken by valuechapter 30
E-MMIO-PERMwrites a read-only registerchapter 30
E-MONO-NOTYPEa generic call gives no leading type argumentchapter 22
E-MREF-SLICEmut ref slice usedchapter 12
E-NAME-BUILTINa builtin op’s name is used for a declaration or localchapter 5, chapter 6
E-NAME-DUPthe same name declared twice in one modulechapter 21
E-NAME-SCOPEa name declared inside a block is read outside itchapter 6
E-NAME-SHADOWre-binds a live name (shadowing)chapter 3, chapter 6
E-OPT-UNUSEDa declared build option that no code readschapter 31
E-OWN-INCOMPLETEa value that needs completion is dropped implicitlychapter 19, chapter 28, chapter 36
E-OWN-JOINownership state differs between brancheschapter 19
E-OWN-MOVEDuses a value after it was movedchapter 19, chapter 25, chapter 28, chapter 35, chapter 36
E-PAR-ASSOCthe reduction operator is not associativechapter 27
E-PAR-CARRYa split loop writes a local that lives across iterationschapter 27
E-PAR-FLOATa floating-point accumulation declared splittablechapter 27
E-PAR-IDENTITYa reduce starts from a value that is not the operator’s identitychapter 27
E-PAR-NOLOOPthe parallel clause finds no loop to splitchapter 27
E-PAR-READa split loop reads another iteration’s elementchapter 27
E-PAR-WRITEa split loop writes another iteration’s elementchapter 27, chapter 45
E-PIPE-NO-TERMINALa stage after the terminalchapter 24
E-PIPE-STAGEa word that is not a pipe stagechapter 24
E-PROFILE-LEVELuses concurrency the build profile does not providechapter 25
E-REGION-ESCAPEcarries region bytes out of the regionchapter 18
E-RETURN-PARTIALsome path does not return a valuechapter 3, chapter 5, chapter 7
E-SPAWN-SCOPEspawns a task outside a task_groupchapter 26
E-STMT-ELSEelse sits inside the blockchapter 7
E-TIER-EFFECTan effect the declared machine tier cannot carrychapter 30
E-TOPLEVELsomething that cannot appear at top level is at top levelchapter 3
E-TRAIT-EFFECTthe implementing op has more effects than the signaturechapter 23
E-TRAIT-MISSINGan op required by the trait is missingchapter 23
E-TRAIT-SIGfn/proc in a signature, or a parameter-count mismatchchapter 23
E-TRY-NORESULTtry used in an op that cannot return that errorchapter 11
E-TYPE-ARGan argument’s type does not match the parameterchapter 12
E-TYPE-ARGMUTa read-only value is passed where it would be written (mut_ref of a let)chapter 9, chapter 12
E-TYPE-ARRAYarray length written after the typechapter 9
E-TYPE-BITCASTbit_cast target is not a plain scalarchapter 20
E-TYPE-COLLECTcollect into would put a wider value into a narrower bufferchapter 24
E-TYPE-CONDa non-boolean in a conditionchapter 4
E-TYPE-DECLbe in a type declarationchapter 13
E-TYPE-FIELDa field is missing or unknown when building a structchapter 10
E-TYPE-INSTANCEmixes different instances of the same genericchapter 35
E-TYPE-KINDa type of the wrong kind for that operation (e.g. cast of bool)chapter 8, chapter 10, chapter 13
E-TYPE-MIXfloat and integer literals mixed in one calculationchapter 4
E-TYPE-MUTwrites an element of a non-mut slicechapter 9
E-TYPE-NOMINALmixes nominally distinct typeschapter 13
E-TYPE-REFwrites through a shared refchapter 12
E-TYPE-REFVALa reference is used as if it were a valuechapter 12
E-TYPE-RETURNthe returned value does not match the op’s output typechapter 11, chapter 31
E-TYPE-SIGNmixes signs with no value-preserving wideningchapter 4, chapter 39, chapter 40
E-TYPE-WIDTHthe value does not fit the declared typechapter 3, chapter 4, chapter 13
E-UNSAFE-UNDECLAREDdeclares the unsafe effect but the op is not marked unsafechapter 29
E-VEC-SPLATsplat was written inline in an expressionchapter 27
E-VISIBILITYreaches a non-exported name of another modulechapter 21
E-VOCAB-REMOVEDa removed word or spellingchapter 3, chapter 5, chapter 7, chapter 15, chapter 48
E-WIDEN-SIGNwiden from a signed to an unsigned typechapter 13
W-EFFECT-OVERan effect declared but never performed (warning)chapter 15, chapter 16
W-EXPORT-HIDDENan exported signature names a type the module keeps to itselfchapter 21
W-NOT-YETa word accepted by name that has no meaning yetchapter 13
W-USE-EXTERNALimports a module not in the compilation unit (warning)chapter 32

Table 50.1 — Diagnostics shown by the examples

When execution stops#

CodeMeaningShown in
E-VM-OVERFLOWinteger overflow at the declared widthchapter 4
E-VM-DIV0division by zerochapter 4
E-VM-CASTa narrowing or cast value does not fitchapter 4
E-VM-SHIFTshift amount not smaller than the widthchapter 4
E-VM-BOUNDSindex out of boundschapter 9
E-VM-NONEtook the value out of nonechapter 11
E-VM-CONTRACTa contract was brokenchapter 14
E-VM-PANICthe program called panicchapter 7
E-VM-ANALYSISan eliminated check was actually needed (compiler bug)chapter 40
E-TEST-FAILan expect in a test is falsechapter 31

Table 50.2 — Run-time diagnostics

Other diagnostics#

These do not appear in the examples but can come up. Most are stops by the VM (the executor) when running with --run. The VM exists for tests and cross-checking, so it holds its resources at fixed sizes, and past a limit it stops rather than quietly giving a wrong value. A limit is the VM’s size, not a defect of the program — the same program built natively usually runs fine.

codemeaning and repair
E-IR-EXTRAoperands are left over after an expr island — an island ends with one expression. Group with parentheses or split the line
E-IR-LIMITa compilation unit has more ops than the tool can carry — split the module
E-IR-LOCALSone op has too many local names — split the op
E-MONO-FIXPOINTgeneric monomorphisation does not finish (the type keeps growing) — break a generic that calls itself at a bigger type
W-COL0a top-level declaration does not start at column 0 — the line may have ended up in the previous declaration’s body
W-UNBOUNDa named contract is declared but no op names it with satisfies
W-RFC-PENDINGa feature whose design is still at the RFC stage was used — nothing in the program to fix
W-CBE-SLOWthis op is lowered to the slow path (tagged values) in native code — --why-slow says why, op by op

Table 50.3 — At translation time — not in the examples

codemeaning and repair
E-VM-ERRok_value was taken from a result that is an error — ask is_ok first or pass it on with try
E-VM-DANGLINGa borrowed reference was used after the place it borrowed from ended (use after return)
E-VM-EXCLa writing borrow of a place overlapped another borrow — end the first borrow before taking the next
E-VM-READONLYwrote through a read-only reference (ref) — borrow with mut_ref to write
E-VM-FIELDread a field that the record or register block does not have
E-VM-AWAITawait was given something that is not a job handle — handles come from spawn <op>
E-VM-CHAN-EMPTY · E-VM-CHAN-FULLreceived from an empty channel or sent to a full one with no scheduler to wait — a wait that can never end
E-VM-SCHED-LOOPhandlers keep sending each other messages, so the scheduler cannot settle
E-VM-FD · E-VM-FMODE · E-VM-FWHENCEa file number that cannot be written (only 1 · 2) · an unknown open mode (0 · 1 · 2) · an unknown seek origin (0 · 1 · 2)
E-VM-FHANDLE · E-VM-SHANDLE · E-VM-REACTORthe value passed is not an open file / socket / reactor handle
E-VM-EXTERNan extern op whose body is in C was called in the VM — build natively to run it
E-VM-MMIO · E-VM-RESERVEa register block at an absolute address / storage handed over by the linker was opened in the VM — they mean something only on the real machine

Table 50.4 — At run time — a mistake in the program

codewhat filled up
E-VM-STACK · E-VM-DEPTH · E-VM-OOMthe operand stack · the call depth · memory to grow the call stack — recursion is too deep
E-VM-BOXPOOL · E-VM-RECPOOL · E-VM-STKPOOL · E-VM-BSETPOOLthe pools for values wrapped by some·ok · struct values · stack containers · bitsets — keep fewer values alive at once
E-VM-CHAN · E-VM-MBOX64 channels · 4096 async mailbox slots — they are not reused, so one run makes at most that many
E-VM-FILEPOOL · E-VM-SOCKPOOLhow many files · sockets can be open at once — close the ones you are done with
E-VM-CHAIN-LIMITVM activations nested inside VM activations went too deep
E-VM-BUDGETthe step budget of a cross-checking (oracle) run ran out — it does not happen in a normal --run

Table 50.5 — At run time — a VM limit (not a defect of the program)