2013-11-07 19:36:17 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
// Issue #8380
|
|
|
|
|
|
|
|
|
2014-08-04 17:42:36 -05:00
|
|
|
use std::sync::atomic::*;
|
2013-11-07 19:36:17 -06:00
|
|
|
use std::ptr;
|
|
|
|
|
|
|
|
fn main() {
|
2014-12-29 17:03:01 -06:00
|
|
|
let x = ATOMIC_BOOL_INIT;
|
2015-01-08 08:12:06 -06:00
|
|
|
let x = *&x; //~ ERROR: cannot move out of borrowed content
|
2015-01-10 15:42:48 -06:00
|
|
|
let x = ATOMIC_ISIZE_INIT;
|
2015-01-08 08:12:06 -06:00
|
|
|
let x = *&x; //~ ERROR: cannot move out of borrowed content
|
2015-01-10 15:42:48 -06:00
|
|
|
let x = ATOMIC_USIZE_INIT;
|
2015-01-08 08:12:06 -06:00
|
|
|
let x = *&x; //~ ERROR: cannot move out of borrowed content
|
2015-01-08 05:02:42 -06:00
|
|
|
let x: AtomicPtr<usize> = AtomicPtr::new(ptr::null_mut());
|
2015-01-08 08:12:06 -06:00
|
|
|
let x = *&x; //~ ERROR: cannot move out of borrowed content
|
2013-11-07 19:36:17 -06:00
|
|
|
}
|