Skip to content

Commit 922fc91

Browse files
authored
task: propagate attributes on task-locals (#4837)
1 parent 5cf22e4 commit 922fc91

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tokio/src/task/task_local.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ macro_rules! task_local {
5151
#[macro_export]
5252
macro_rules! __task_local_inner {
5353
($(#[$attr:meta])* $vis:vis $name:ident, $t:ty) => {
54+
$(#[$attr])*
5455
$vis static $name: $crate::task::LocalKey<$t> = {
5556
std::thread_local! {
5657
static __KEY: std::cell::RefCell<Option<$t>> = const { std::cell::RefCell::new(None) };
@@ -66,6 +67,7 @@ macro_rules! __task_local_inner {
6667
#[macro_export]
6768
macro_rules! __task_local_inner {
6869
($(#[$attr:meta])* $vis:vis $name:ident, $t:ty) => {
70+
$(#[$attr])*
6971
$vis static $name: $crate::task::LocalKey<$t> = {
7072
std::thread_local! {
7173
static __KEY: std::cell::RefCell<Option<$t>> = std::cell::RefCell::new(None);

0 commit comments

Comments
 (0)