16 lines
301 B
Rust
16 lines
301 B
Rust
// An atomic cell is borrowed with `ref`, never `mut`.
|
|
// expect: reject E7005
|
|
// phase: 6
|
|
// spec: docs/spec/15-source-language.md
|
|
module demo.mut_borrow
|
|
|
|
fn main() -> u64
|
|
effects [atomic]
|
|
{
|
|
let c = atomic.new(1u64);
|
|
{
|
|
mut m = c; // diagnostic here: c
|
|
}
|
|
atomic.take(move c)
|
|
}
|