Skip to content

Commit

Permalink
Fix newtype_index
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 12, 2019
1 parent 7c19e1e commit 48757a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/librustc_data_structures/indexed_vec.rs
Expand Up @@ -286,13 +286,15 @@ macro_rules! newtype_index {
);

// Append comma to end of derives list if it's missing
(@type [$type:ident]
(@attrs [$(#[$attrs:meta])*]
@type [$type:ident]
@max [$max:expr]
@vis [$v:vis]
@debug_format [$debug_format:tt]
derive [$($derives:ident),*]
$($tokens:tt)*) => (
newtype_index!(
@attrs [$(#[$attrs])*]
@type [$type]
@max [$max]
@vis [$v]
Expand All @@ -303,14 +305,16 @@ macro_rules! newtype_index {

// By not including the @derives marker in this list nor in the default args, we can force it
// to come first if it exists. When encodable is custom, just use the derives list as-is.
(@type [$type:ident]
(@attrs [$(#[$attrs:meta])*]
@type [$type:ident]
@max [$max:expr]
@vis [$v:vis]
@debug_format [$debug_format:tt]
derive [$($derives:ident,)+]
ENCODABLE = custom
$($tokens:tt)*) => (
newtype_index!(
@attrs [$(#[$attrs])*]
@derives [$($derives,)+]
@type [$type]
@max [$max]
Expand Down

0 comments on commit 48757a7

Please sign in to comment.