From 516f660312eec2546a55cc6df7a80a9b616a1435 Mon Sep 17 00:00:00 2001 From: Arnavion Date: Wed, 13 Jul 2022 21:17:24 -0700 Subject: [PATCH] task: propagate attrs on task_local items to the generated items Discovered while trying to add a `#[allow]` to try to work around #4836 --- tokio/src/task/task_local.rs | 2 ++ 1 file changed, 2 insertions(+) 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> = const { std::cell::RefCell::new(None) }; @@ -66,6 +67,7 @@ macro_rules! __task_local_inner { #[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> = std::cell::RefCell::new(None);