]> git.lizzy.rs Git - rust.git/blob - src/test/ui/std-uncopyable-atomics.rs
Merge commit '2bb3996244cf1b89878da9e39841e9f6bf061602' into sync_cg_clif-2022-12-14
[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 }