about summary refs log tree commit diff
path: root/src/libcore/sync
diff options
context:
space:
mode:
authorOliver Middleton <olliemail27@gmail.com>2017-11-27 01:23:04 +0000
committerOliver Middleton <olliemail27@gmail.com>2017-11-27 01:23:04 +0000
commit652a4bd26cd9adcb9b8bf03c220b0fa430a9893b (patch)
tree927f39a110b8afe0fa10b1016acca2ae5dd178fb /src/libcore/sync
parent5f44c653cff61d0f55f53e07a188f755c7acddd1 (diff)
downloadrust-652a4bd26cd9adcb9b8bf03c220b0fa430a9893b.tar.gz
rust-652a4bd26cd9adcb9b8bf03c220b0fa430a9893b.zip
impl From<bool> for AtomicBool
Diffstat (limited to 'src/libcore/sync')
-rw-r--r--src/libcore/sync/atomic.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs
index b7cf6d778a2..352e85d2b08 100644
--- a/src/libcore/sync/atomic.rs
+++ b/src/libcore/sync/atomic.rs
@@ -927,6 +927,13 @@ impl<T> AtomicPtr<T> {
     }
 }
 
+#[cfg(target_has_atomic = "8")]
+#[stable(feature = "atomic_from", since = "1.23.0")]
+impl From<bool> for AtomicBool {
+    #[inline]
+    fn from(b: bool) -> Self { Self::new(b) }
+}
+
 #[cfg(target_has_atomic = "ptr")]
 #[stable(feature = "atomic_from", since = "1.23.0")]
 impl<T> From<*mut T> for AtomicPtr<T> {