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 §25; docs/spec/15-source-language.md §16
|
||||
module test.linear
|
||||
// AIR twin: linear/field.air
|
||||
struct Pair { value: own<u64>, tag: u64 }
|
||||
fn main(heap: cap<mem.alloc>) -> u64 effects [mem.alloc] {
|
||||
let owner = own.new(42u64, heap) or trap;
|
||||
let record = Pair { value: move owner, tag: 1u64 };
|
||||
let bad = record.value;
|
||||
let bad = record.value; // diagnostic here: record.value
|
||||
let (part, tag) = struct.unpack(move record);
|
||||
assert(tag == 1);
|
||||
return own.take(move part);
|
||||
|
||||
Reference in new issue
Block a user