tests: extend audited rejection twins through tasks and locks

This commit is contained in:
dev committed 2026-10-08 18:12:53 +03:00
1 parent e4aacef48c
commit 272aebfd32
16 files changed
+157 -13

No files matched your search

@@ -3,6 +3,7 @@
// phase: 6
// spec: docs/spec/15-source-language.md
module demo.access_lent
// AIR twin: phase3/reject/tasks_access_lent.air
fn bump(s: slice_mut<u64>) -> void
effects []
@@ -20,7 +21,7 @@ effects [task.spawn]
let (l, r) = s.split_at(2);
scope sc {
let a = task.spawn(sc, bump, l);
seen = l[0];
seen = l[0]; // diagnostic here: l[0]
task.join(move a);
}
}
@@ -3,11 +3,12 @@
// phase: 6
// spec: docs/spec/15-source-language.md
module demo.receiver_leak
// AIR twin: phase3/reject/channels_receiver_leak.air
fn main(heap: cap<mem.alloc>) -> u64
effects [mem.alloc, task.wait]
{
match channel.make<u64>(1, heap) {
match channel.make<u64>(1, heap) { // diagnostic here
ok(tx, rx) => {
channel.close_sender(move tx);
0
@@ -3,6 +3,7 @@
// phase: 6
// spec: docs/spec/15-source-language.md
module demo.same_mut_twice
// AIR twin: phase3/reject/tasks_same_mut_twice.air
fn bump(s: slice_mut<u64>) -> void
effects []
@@ -18,7 +19,7 @@ effects [task.spawn]
mut s = buf;
scope sc {
let a = task.spawn(sc, bump, s);
let b = task.spawn(sc, bump, s);
let b = task.spawn(sc, bump, s); // diagnostic here: task.spawn
task.join(move a);
task.join(move b);
}
@@ -3,6 +3,7 @@
// phase: 6
// spec: docs/spec/15-source-language.md
module demo.scope_unjoined
// AIR twin: phase3/reject/tasks_scope_end_unjoined.air
fn work() -> u64
effects []
@@ -13,7 +14,7 @@ effects []
fn main() -> u64
effects [task.spawn]
{
scope sc {
scope sc { // diagnostic here: {
let t = task.spawn(sc, work);
}
0