aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs21
1 files changed, 2 insertions, 19 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ba1d331..b432c1f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -62,7 +62,6 @@
unreachable_pub
)]
#![cfg_attr(not(feature = "std"), no_std)]
-#![cfg_attr(feature = "nightly", feature(const_fn_trait_bound))]
#[cfg(crossbeam_loom)]
extern crate loom_crate as loom;
@@ -78,19 +77,7 @@ mod primitive {
pub(crate) mod sync {
pub(crate) mod atomic {
use core::sync::atomic::Ordering;
- pub(crate) use loom::sync::atomic::AtomicUsize;
- pub(crate) fn fence(ord: Ordering) {
- if let Ordering::Acquire = ord {
- } else {
- // FIXME: loom only supports acquire fences at the moment.
- // https://github.com/tokio-rs/loom/issues/117
- // let's at least not panic...
- // this may generate some false positives (`SeqCst` is stronger than `Acquire`
- // for example), and some false negatives (`Relaxed` is weaker than `Acquire`),
- // but it's the best we can do for the time being.
- }
- loom::sync::atomic::fence(Ordering::Acquire)
- }
+ pub(crate) use loom::sync::atomic::{fence, AtomicUsize};
// FIXME: loom does not support compiler_fence at the moment.
// https://github.com/tokio-rs/loom/issues/117
@@ -101,7 +88,6 @@ mod primitive {
}
pub(crate) use loom::sync::Arc;
}
- pub(crate) use loom::lazy_static;
pub(crate) use loom::thread_local;
}
#[cfg(not(crossbeam_no_atomic_cas))]
@@ -121,7 +107,7 @@ mod primitive {
// https://github.com/tokio-rs/loom#handling-loom-api-differences
impl<T> UnsafeCell<T> {
#[inline]
- pub(crate) fn new(data: T) -> UnsafeCell<T> {
+ pub(crate) const fn new(data: T) -> UnsafeCell<T> {
UnsafeCell(::core::cell::UnsafeCell::new(data))
}
@@ -148,9 +134,6 @@ mod primitive {
#[cfg(feature = "std")]
pub(crate) use std::thread_local;
-
- #[cfg(feature = "std")]
- pub(crate) use lazy_static::lazy_static;
}
#[cfg(not(crossbeam_no_atomic_cas))]