diff options
| author | Camelid <camelidcamel@gmail.com> | 2021-02-28 11:53:55 -0800 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2021-02-28 11:53:55 -0800 |
| commit | 58758f0275172da24ee311e354cd9a7fe79c6e39 (patch) | |
| tree | cf54a5648a094de9fca582d73c3dff309c4fda2e /compiler/rustc_data_structures/src | |
| parent | e5f1e8883af5efae2eaf12f7b25e3bfe5573ba47 (diff) | |
| download | rust-58758f0275172da24ee311e354cd9a7fe79c6e39.tar.gz rust-58758f0275172da24ee311e354cd9a7fe79c6e39.zip | |
Allow variant attributes in `enum_from_u32!`
Diffstat (limited to 'compiler/rustc_data_structures/src')
| -rw-r--r-- | compiler/rustc_data_structures/src/macros.rs | 8 |
1 files changed, 4 insertions, 4 deletions
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 { |
