task: propagate attributes on task-locals (#4837)

This commit is contained in:
Arnav Singh
2022-07-14 11:32:28 +02:00
committed by GitHub
parent 5cf22e48c5
commit 922fc91408
+2
View File
@@ -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) };
@@ -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);