diff --git a/tokio/src/task/task_local.rs b/tokio/src/task/task_local.rs
index e92b05fdc98..40447236789 100644
--- a/tokio/src/task/task_local.rs
+++ b/tokio/src/task/task_local.rs
@@ -51,6 +51,7 @@ macro_rules! task_local {
#[macro_export]
macro_rules! __task_local_inner {
($(#[$attr:meta])* $vis:vis $name:ident, $t:ty) => {
+ $(#[$attr])*
$vis static $name: $crate::task::LocalKey<$t> = {
std::thread_local! {
static __KEY: std::cell::RefCell