15 lines
390 B
Rust
15 lines
390 B
Rust
// An arc holds only ArcSafe values: a mutex is Share but not ArcSafe.
|
|
// expect: reject E2111
|
|
// 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; // diagnostic here: arc.new
|
|
arc.release(move a);
|
|
0
|
|
}
|