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

+2
View File
@@ -346,6 +346,8 @@ region.destroy → used -= every allocation of the region
- A region allocation `%p` is an owned borrow whose parent is the shared region borrow `%rb` and whose path is a fresh element unique to that allocation. Allocations are therefore disjoint from each other, and the exclusive borrow `mut<T>` of a fresh object does not conflict with the shared parent (this is the one place where an exclusive child of a shared borrow is permitted, because the storage is new).
- `region.reset %r` and `region.destroy %r` are exclusive accesses to the region value. If a **live reference** into the region exists — any live borrow derived from `%r`, in particular a live borrow of an allocation — the instruction is `E2104` (`memory.region_generation`): reset or destroy would invalidate a live reference. Allocations whose borrows have all ended are not an obstacle; destroying them is what `reset` and `destroy` are for.
An identified E2104 conflict includes the selected reference's definition position (spec 10 §2), without changing generation or borrow rules.
- Ending `%rb` while one of its allocations is live is `E2102`, so no allocation outlives the borrow it came from.
- A function may return a region allocation with `from %rb` when `%rb` is a `ref<region>` parameter (spec 08 §11.3 applies unchanged: the root is the parameter). Frame-derived borrows still never escape (`E2108`).