Skip to content

Commit

Permalink
task: propagate attributes on task-locals (#4837)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnavion committed Jul 14, 2022
1 parent 5cf22e4 commit 922fc91
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tokio/src/task/task_local.rs
Expand Up @@ -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<Option<$t>> = const { std::cell::RefCell::new(None) };
Expand All @@ -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<Option<$t>> = std::cell::RefCell::new(None);
Expand Down

0 comments on commit 922fc91

Please sign in to comment.