about summary refs log tree commit diff
diff options
context:
space:
mode:
authorWilliam Throwe <wtt6@cornell.edu>2015-07-15 08:11:35 -0400
committerWilliam Throwe <wtt6@cornell.edu>2015-07-16 00:46:04 -0400
commit3a4904f06f5d39bfa50d1cd55e6ad6229c34045d (patch)
tree945b8969c1007a5952fd67d562a157504b17b6e0
parentfd1b0305a3bbf53929cc67f52dae166dcd0cc075 (diff)
downloadrust-3a4904f06f5d39bfa50d1cd55e6ad6229c34045d.tar.gz
rust-3a4904f06f5d39bfa50d1cd55e6ad6229c34045d.zip
Add regression test for atomics being Send + Sync
Thanks to Tamir Duberstein for the implementation suggestion.
-rw-r--r--src/test/run-pass/sync-send-atomics.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/test/run-pass/sync-send-atomics.rs b/src/test/run-pass/sync-send-atomics.rs
new file mode 100644
index 00000000000..1ead6268d0c
--- /dev/null
+++ b/src/test/run-pass/sync-send-atomics.rs
@@ -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() {}