diag: add factual related borrow and task locations

This commit is contained in:
dev committed 2026-10-07 19:12:58 +03:00
1 parent dbd9763713
commit 8ee0f4c2bf
27 files changed
+659 -18

No files matched your search

@@ -16,6 +16,15 @@ Every verifier/compiler error has:
Code-specific `reason` values MUST be registered and stable; consumers MUST NOT derive them from human messages. E7006 requires the categories in spec 15 §10 and `reference/error-codes.md`.
`related_locations` MAY provide ordered, non-binding factual context; the covered forms below MUST provide exactly one record for the already selected conflict. Other forms MUST NOT invent a value or task.
| Diagnostic field | Related `role` | Related `value` | Position |
|---|---|---|---|
| E2101/E2104 `conflicts_with` | `conflicting_borrow` | same as `conflicts_with` | that value's definition |
| E4302 `task` | `task_spawn` | same as `task` | the task's creating spawn, retained through cancelled-join handle replacement |
A record MUST serialize `role`, `value`, then `file`, `line`, `col` when located (the primary position's conventions), then `air_line`, `air_col` for lowered AIR (spec 15 §10). `related_locations` MUST be omitted when empty and otherwise appended after existing envelope fields. Roles and identities MUST be factual; positions identify syntax, not execution order or a repair. Primary positions/fields, first-conflict selection, diagnostic order and duplicate suppression MUST remain unchanged; discarded duplicates MUST NOT contribute related records. No borrow, loan, acceptance rule or runtime behavior changes.
Example:
```json