Skip to content

Commit fc9abbd

Browse files
authored
Rollup merge of rust-lang#46293 - ollie27:atomic_bool_from, r=BurntSushi
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`.~~
2 parents 0e78c29 + 71d766b commit fc9abbd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libcore/sync/atomic.rs

+7
Original file line numberDiff line numberDiff line change
@@ -924,6 +924,13 @@ impl<T> AtomicPtr<T> {
924924
}
925925
}
926926

927+
#[cfg(target_has_atomic = "8")]
928+
#[stable(feature = "atomic_bool_from", since = "1.24.0")]
929+
impl From<bool> for AtomicBool {
930+
#[inline]
931+
fn from(b: bool) -> Self { Self::new(b) }
932+
}
933+
927934
#[cfg(target_has_atomic = "ptr")]
928935
#[stable(feature = "atomic_from", since = "1.23.0")]
929936
impl<T> From<*mut T> for AtomicPtr<T> {

0 commit comments

Comments
 (0)