Auto merge of #27052 - wthrowe:atomic_send, r=Gankro
I think this was just missed when `Send` and `Sync` were redone, since it seems odd to not be able to use things like `Arc<AtomicPtr>`. If it was intentional feel free to just close this. I used another test as a template for writing mine, so I hope I got all the headers and stuff right.
This commit is contained in:
commit
8b9ada5997
@ -72,7 +72,7 @@
|
||||
|
||||
use self::Ordering::*;
|
||||
|
||||
use marker::Sync;
|
||||
use marker::{Send, Sync};
|
||||
|
||||
use intrinsics;
|
||||
use cell::UnsafeCell;
|
||||
@ -134,6 +134,7 @@ fn default() -> AtomicPtr<T> {
|
||||
}
|
||||
}
|
||||
|
||||
unsafe impl<T> Send for AtomicPtr<T> {}
|
||||
unsafe impl<T> Sync for AtomicPtr<T> {}
|
||||
|
||||
/// Atomic memory orderings
|
||||
|
22
src/test/run-pass/sync-send-atomics.rs
Normal file
22
src/test/run-pass/sync-send-atomics.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// Copyright 2015 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.
|
||||
|
||||
// pretty-expanded FIXME #23616
|
||||
|
||||
use std::sync::atomic::*;
|
||||
|
||||
trait SendSync: Send + Sync {}
|
||||
|
||||
impl SendSync for AtomicBool {}
|
||||
impl SendSync for AtomicIsize {}
|
||||
impl SendSync for AtomicUsize {}
|
||||
impl<T> SendSync for AtomicPtr<T> {}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user