]> git.lizzy.rs Git - rust.git/blob - src/test/ui/std-uncopyable-atomics.rs
Auto merge of #101768 - sunfishcode:sunfishcode/wasi-stdio-lock-asfd, r=joshtriplett
[rust.git] / src / test / ui / std-uncopyable-atomics.rs
1 // Issue #8380
2
3
4 use std::sync::atomic::*;
5 use std::ptr;
6
7 fn main() {
8     let x = AtomicBool::new(false);
9     let x = *&x; //~ ERROR: cannot move out of a shared reference
10     let x = AtomicIsize::new(0);
11     let x = *&x; //~ ERROR: cannot move out of a shared reference
12     let x = AtomicUsize::new(0);
13     let x = *&x; //~ ERROR: cannot move out of a shared reference
14     let x: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
15     let x = *&x; //~ ERROR: cannot move out of a shared reference
16 }