mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-31 00:00:07 +02:00
task: add missing feature flags for task_local (#3236)
This commit is contained in:
@@ -31,6 +31,7 @@ use std::{fmt, thread};
|
||||
///
|
||||
/// [`tokio::task::LocalKey`]: struct@crate::task::LocalKey
|
||||
#[macro_export]
|
||||
#[cfg_attr(docsrs, doc(cfg(all(feature = "rt-util", feature = "rt-core"))))]
|
||||
macro_rules! task_local {
|
||||
// empty (base case for the recursion)
|
||||
() => {};
|
||||
@@ -90,6 +91,7 @@ macro_rules! __task_local_inner {
|
||||
/// # }
|
||||
/// ```
|
||||
/// [`std::thread::LocalKey`]: struct@std::thread::LocalKey
|
||||
#[cfg_attr(docsrs, doc(cfg(all(feature = "rt-util", feature = "rt-core"))))]
|
||||
pub struct LocalKey<T: 'static> {
|
||||
#[doc(hidden)]
|
||||
pub inner: thread::LocalKey<RefCell<Option<T>>>,
|
||||
|
||||
Reference in New Issue
Block a user