diff options
| author | kennytm <kennytm@gmail.com> | 2017-11-29 18:37:50 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-11-29 18:37:50 +0800 |
| commit | fc9abbd7b73ae2ba5ba97ad158e8f1ff664bd9bf (patch) | |
| tree | 1aee1a8398f5d98ea98d7dd111a168a3cbfb1445 /src/libcore/sync | |
| parent | 0e78c29bea998081cb1880da9fa09e38d46d44a6 (diff) | |
| parent | 71d766bd553967cfeb8a39cbcf6c2c97f3617208 (diff) | |
| download | rust-fc9abbd7b73ae2ba5ba97ad158e8f1ff664bd9bf.tar.gz rust-fc9abbd7b73ae2ba5ba97ad158e8f1ff664bd9bf.zip | |
Rollup merge of #46293 - ollie27:atomic_bool_from, r=BurntSushi
impl From<bool> for AtomicBool This seems like an obvious omission from #45610. ~~I've used the same feature name and version in the hope that this can be backported to beta so it's stabilized with the other impls. If it can't be I'll change it to `1.24.0`.~~
Diffstat (limited to 'src/libcore/sync')
| -rw-r--r-- | src/libcore/sync/atomic.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/sync/atomic.rs b/src/libcore/sync/atomic.rs index d52302194a2..4c6ff4d1bb4 100644 --- a/src/libcore/sync/atomic.rs +++ b/src/libcore/sync/atomic.rs @@ -924,6 +924,13 @@ impl<T> AtomicPtr<T> { } } +#[cfg(target_has_atomic = "8")] +#[stable(feature = "atomic_bool_from", since = "1.24.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> { |
