aboutsummaryrefslogtreecommitdiff
path: root/docs/SPEC.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/SPEC.md')
-rw-r--r--docs/SPEC.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/docs/SPEC.md b/docs/SPEC.md
index 06ee11c..923e24b 100644
--- a/docs/SPEC.md
+++ b/docs/SPEC.md
@@ -884,7 +884,7 @@ char* tail(char* s) { return s + 1; }
char* b = rt.new(4); b[0] = 'a'; b[1] = 'b'; b[2] = 0;
char* t = tail(b);
rt.free(b);
-rt.put_s(t); // error: t: used after it was given away; owner b was transferred on line N (declared on line M)
+rt.put_s(t); // error: t: used after it was given away; t borrows b, and b was freed on line N (b declared on line M)
```
placing `rt.free(b)` after the use is accepted (the alias's last use precedes the transfer).
@@ -948,7 +948,7 @@ rt.outbuf = saved;
each fixture in `tests/errors/` starts with `// expect: MESSAGE`; the messages that the analyzer produces are (X is a variable name):
-- X: used after it was given away; owner Y was transferred on line N (declared on line M)
+- X: used after it was given away; X borrows Y, and Y was HOW on line N (Y declared on line M), or, for the owner itself, X was HOW on line N (declared on line M). HOW is one of: freed, freed by reassigning it, given to F's .d parameter, moved into Z, stored into Z, pushed into an array, stored in a global or untracked memory, returned, or transferred when the analyzer has no more specific cause
- X: owned object is never used
- X: still owns an object; overwriting it would leak it
- X: is an owned object and can't be copied into another variable