Skip to content
Permalink
Browse files

Fix newtype_index

  • Loading branch information...
Zoxc committed Mar 9, 2019
1 parent 7c19e1e commit 48757a70a382afe27d5469fdcfbe5d434c9d4097
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/librustc_data_structures/indexed_vec.rs
@@ -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]
@@ -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]

0 comments on commit 48757a7

Please sign in to comment.
You can’t perform that action at this time.