mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-03 00:00:05 +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
|
/// [`tokio::task::LocalKey`]: struct@crate::task::LocalKey
|
||||||
#[macro_export]
|
#[macro_export]
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(all(feature = "rt-util", feature = "rt-core"))))]
|
||||||
macro_rules! task_local {
|
macro_rules! task_local {
|
||||||
// empty (base case for the recursion)
|
// empty (base case for the recursion)
|
||||||
() => {};
|
() => {};
|
||||||
@@ -90,6 +91,7 @@ macro_rules! __task_local_inner {
|
|||||||
/// # }
|
/// # }
|
||||||
/// ```
|
/// ```
|
||||||
/// [`std::thread::LocalKey`]: struct@std::thread::LocalKey
|
/// [`std::thread::LocalKey`]: struct@std::thread::LocalKey
|
||||||
|
#[cfg_attr(docsrs, doc(cfg(all(feature = "rt-util", feature = "rt-core"))))]
|
||||||
pub struct LocalKey<T: 'static> {
|
pub struct LocalKey<T: 'static> {
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub inner: thread::LocalKey<RefCell<Option<T>>>,
|
pub inner: thread::LocalKey<RefCell<Option<T>>>,
|
||||||
|
|||||||
Reference in New Issue
Block a user