Diagnostics reference
Every memory-model diagnostic has a stable code. The code and the primary source position are stable; the message text, labels and help: line may change. Errors stop the build (exit status 1); warnings do not, unless you pass -Werror.
The pages below are generated by website/scripts/gen-diagnostics.mjs from the test corpus compiler/testdata/memory/ and the output of the real compiler, so they cannot drift from the implementation. Only the prose is hand-written.
| Code | Severity | Meaning | Corpus programs |
|---|---|---|---|
| M0101 | error | Use after free | 5 |
| M0102 | error | Leak: allocation is never released | 13 |
| M0103 | error | Double free | 3 |
| M0104 | error | Use after move | 7 |
| M0105 | error | Escape from a Scoped allocator | 5 |
| M0106 | error | Individual free of a Scoped object | 2 |
| M0107 | error | Release of a non-owned value | 3 |
| M0108 | error | Wrong allocator when freeing | 1 |
| M0109 | error | Loan is stored or returned as owned | 3 |
| M0110 | error | Violation of the Strict/Managed boundary | 3 |
| M0111 | error | Invalid ownership annotation | 1 |
| M0112 | error | Owning value in an escaping lambda | 1 |
| M0113 | error | Owned field stays moved | 1 |
| M0114 | error | Ambiguous allocator | 1 |
| M0115 | error | Arena object owns a foreign reference | 3 |
| M0201 | info (planned) | Allocation moved to the stack | 0 |
| M0202 | warning | Allocation in an arena loop | 1 |
| M0203 | warning (planned) | Large object on the stack | 0 |
| M0204 | error | No allocator for an escaping Strict value | 1 |
| M0205 | error | Allocation in a @NoAlloc function | 1 |
| M0206 | error | Object leaves the thread but its allocator is not ThreadSafe | 1 |
Output format
<severity>[<code>]: <message>
--> <file>:<line>:<col> <label>
<line> | <source line>
| <caret under the primary position>
help: <text>
note: <code> (<title>): <link to its page>Every code that was reported is named once at the end with its title and the link to its page. For editors and tools, the released minic (the self-hosted one) prints, with --error-format=json, one JSON object per diagnostic on stderr (severity, code, message, file, line, col, endCol, label, secondary, help, docs); --color=always|never|auto and NO_COLOR control colors and --error-limit=N stops printing after N diagnostics.
With ./minic check --brief file.kt the compiler prints only line:col: CODE lines on stdout; this is what the test corpus compares.