task: add missing feature flags for task_local (#3236)

This commit is contained in:
Nylonicious
2020-12-10 08:29:12 +01:00
committed by GitHub
parent 95b943506b
commit dccc58aa37
+2
View File
@@ -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>>>,