From 58758f0275172da24ee311e354cd9a7fe79c6e39 Mon Sep 17 00:00:00 2001 From: Camelid Date: Sun, 28 Feb 2021 11:53:55 -0800 Subject: Allow variant attributes in `enum_from_u32!` --- compiler/rustc_data_structures/src/macros.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_data_structures/src') diff --git a/compiler/rustc_data_structures/src/macros.rs b/compiler/rustc_data_structures/src/macros.rs index b918ed9458c..48dfbba7504 100644 --- a/compiler/rustc_data_structures/src/macros.rs +++ b/compiler/rustc_data_structures/src/macros.rs @@ -9,11 +9,11 @@ macro_rules! static_assert_size { #[macro_export] macro_rules! enum_from_u32 { ($(#[$attr:meta])* pub enum $name:ident { - $($variant:ident = $e:expr,)* + $($(#[$var_attr:meta])* $variant:ident = $e:expr,)* }) => { $(#[$attr])* pub enum $name { - $($variant = $e),* + $($(#[$var_attr])* $variant = $e),* } impl $name { @@ -26,11 +26,11 @@ macro_rules! enum_from_u32 { } }; ($(#[$attr:meta])* pub enum $name:ident { - $($variant:ident,)* + $($(#[$var_attr:meta])* $variant:ident,)* }) => { $(#[$attr])* pub enum $name { - $($variant,)* + $($(#[$var_attr])* $variant,)* } impl $name { -- cgit 1.4.1-3-g733a5