Skip to content

Commit 8b9ada5

Browse files
committed
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.
2 parents 0bc993c + 3a4904f commit 8b9ada5

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/libcore/atomic.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272

7373
use self::Ordering::*;
7474

75-
use marker::Sync;
75+
use marker::{Send, Sync};
7676

7777
use intrinsics;
7878
use cell::UnsafeCell;
@@ -134,6 +134,7 @@ impl<T> Default for AtomicPtr<T> {
134134
}
135135
}
136136

137+
unsafe impl<T> Send for AtomicPtr<T> {}
137138
unsafe impl<T> Sync for AtomicPtr<T> {}
138139

139140
/// Atomic memory orderings
+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// pretty-expanded FIXME #23616
12+
13+
use std::sync::atomic::*;
14+
15+
trait SendSync: Send + Sync {}
16+
17+
impl SendSync for AtomicBool {}
18+
impl SendSync for AtomicIsize {}
19+
impl SendSync for AtomicUsize {}
20+
impl<T> SendSync for AtomicPtr<T> {}
21+
22+
fn main() {}

0 commit comments

Comments
 (0)