tests: extend rejection twins across public semantic features
This commit is contained in:
1 parent
272aebfd32
commit
06d8a1a76a
32 files changed
+396
-22
No files matched your search
@@ -3,11 +3,12 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/03-memory-model.md
|
||||
module demo.arc_mutex
|
||||
// AIR twin: phase4/reject/arc_content_mutex.air
|
||||
|
||||
fn main(heap: cap<mem.alloc>) -> u64
|
||||
effects [mem.alloc]
|
||||
{
|
||||
let a = arc.new(mutex.make(0u64), heap) or trap;
|
||||
let a = arc.new(mutex.make(0u64), heap) or trap; // diagnostic here: arc.new
|
||||
arc.release(move a);
|
||||
0
|
||||
}
|
||||
@@ -3,12 +3,13 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/03-memory-model.md
|
||||
module demo.content_owner
|
||||
// AIR twin: phase4/reject/island_content_owner.air
|
||||
|
||||
fn main(heap: cap<mem.alloc>) -> u64
|
||||
effects [mem.alloc]
|
||||
{
|
||||
let o = own.new(1u64, heap) or trap;
|
||||
let isl = island.create(move o, heap) or trap;
|
||||
let isl = island.create(move o, heap) or trap; // diagnostic here: island.create
|
||||
island.destroy(move isl);
|
||||
0
|
||||
}
|
||||
@@ -11,7 +11,7 @@ effects [mem.alloc]
|
||||
{
|
||||
ref g = f;
|
||||
let r = frozen.root(g);
|
||||
mut x = frozen.at(g, r);
|
||||
mut x = frozen.at(g, r); // diagnostic here
|
||||
*x = 2;
|
||||
}
|
||||
frozen.release(move f);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/03-memory-model.md
|
||||
module demo.two_mut_access
|
||||
// AIR twin: phase4/reject/island_two_mut.air
|
||||
|
||||
fn main(heap: cap<mem.alloc>) -> u64
|
||||
effects [mem.alloc]
|
||||
@@ -13,7 +14,7 @@ effects [mem.alloc]
|
||||
let a = island.root(g);
|
||||
let b = island.alloc(g, 2u64) or trap;
|
||||
mut x = island.at(g, a);
|
||||
mut y = island.at(g, b);
|
||||
mut y = island.at(g, b); // diagnostic here
|
||||
}
|
||||
island.destroy(move isl);
|
||||
0
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
// phase: 6
|
||||
// spec: docs/spec/03-memory-model.md
|
||||
module demo.use_after_send
|
||||
// AIR twin: phase4/reject/island_use_after_send.air
|
||||
|
||||
fn main(heap: cap<mem.alloc>) -> u64
|
||||
effects [mem.alloc, task.wait]
|
||||
@@ -12,7 +13,7 @@ effects [mem.alloc, task.wait]
|
||||
let isl = island.create(1u64, heap) or trap;
|
||||
channel.send(tx, move isl) or trap;
|
||||
{
|
||||
ref g = isl;
|
||||
ref g = isl; // diagnostic here
|
||||
let r = island.root(g);
|
||||
}
|
||||
channel.close_sender(move tx);
|
||||
|
||||
Reference in new issue
Block a user