]> git.lizzy.rs Git - rust.git/blob - src/test/ui/std-uncopyable-atomics.rs
Rollup merge of #57107 - mjbshaw:thread_local_test, r=nikomatsakis
[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 borrowed content
10     let x = AtomicIsize::new(0);
11     let x = *&x; //~ ERROR: cannot move out of borrowed content
12     let x = AtomicUsize::new(0);
13     let x = *&x; //~ ERROR: cannot move out of borrowed content
14     let x: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
15     let x = *&x; //~ ERROR: cannot move out of borrowed content
16 }