aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/linked_list.rs2
-rw-r--r--src/util/mod.rs7
-rw-r--r--src/util/once_cell.rs4
3 files changed, 9 insertions, 4 deletions
diff --git a/src/util/linked_list.rs b/src/util/linked_list.rs
index 9698f72..b46bd6d 100644
--- a/src/util/linked_list.rs
+++ b/src/util/linked_list.rs
@@ -126,7 +126,7 @@ impl<L: Link> LinkedList<L, L::Target> {
pub(crate) fn push_front(&mut self, val: L::Handle) {
// The value should not be dropped, it is being inserted into the list
let val = ManuallyDrop::new(val);
- let ptr = L::as_raw(&*val);
+ let ptr = L::as_raw(&val);
assert_ne!(self.head, Some(ptr));
unsafe {
L::pointers(ptr).as_mut().set_next(self.head);
diff --git a/src/util/mod.rs b/src/util/mod.rs
index 245e64d..9f6119a 100644
--- a/src/util/mod.rs
+++ b/src/util/mod.rs
@@ -6,7 +6,12 @@ cfg_io_driver! {
#[cfg(feature = "rt")]
pub(crate) mod atomic_cell;
-#[cfg(any(feature = "rt", feature = "signal", feature = "process"))]
+#[cfg(any(
+ feature = "rt",
+ feature = "signal",
+ feature = "process",
+ tokio_no_const_mutex_new,
+))]
pub(crate) mod once_cell;
#[cfg(any(
diff --git a/src/util/once_cell.rs b/src/util/once_cell.rs
index 138d2a7..1925f0a 100644
--- a/src/util/once_cell.rs
+++ b/src/util/once_cell.rs
@@ -25,7 +25,7 @@ impl<T> OnceCell<T> {
/// If the `init` closure panics, then the `OnceCell` is poisoned and all
/// future calls to `get` will panic.
#[inline]
- pub(crate) fn get(&self, init: fn() -> T) -> &T {
+ pub(crate) fn get(&self, init: impl FnOnce() -> T) -> &T {
if !self.once.is_completed() {
self.do_init(init);
}
@@ -41,7 +41,7 @@ impl<T> OnceCell<T> {
}
#[cold]
- fn do_init(&self, init: fn() -> T) {
+ fn do_init(&self, init: impl FnOnce() -> T) {
let value_ptr = self.value.get() as *mut T;
self.once.call_once(|| {