Skip to content

Commit

Permalink
Rollup merge of rust-lang#46293 - ollie27:atomic_bool_from, r=BurntSushi
Browse files Browse the repository at this point in the history
impl From<bool> for AtomicBool

This seems like an obvious omission from rust-lang#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`.~~
  • Loading branch information
kennytm authored Nov 29, 2017
2 parents 0e78c29 + 71d766b commit fc9abbd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libcore/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand Down

0 comments on commit fc9abbd

Please sign in to comment.