diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-08-02 12:14:20 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-08-02 12:14:20 +0200 |
| commit | 89dce46efdc7a626436b0ac8f825ac795a8799ad (patch) | |
| tree | 9e680570782019fb445804e0b57a752531d884ce /src/libsyntax | |
| parent | dbfe12daed1ede9d2ccb6bf749143368bc5eade4 (diff) | |
| parent | 2aa368aa0e152435da7f8a7a51d005c50965c860 (diff) | |
| download | rust-89dce46efdc7a626436b0ac8f825ac795a8799ad.tar.gz rust-89dce46efdc7a626436b0ac8f825ac795a8799ad.zip | |
Rollup merge of #63198 - rbartlensky:fix-macro-trailing-comma, r=petrochenkov
Allow trailing comma in macro 2.0 declarations. This should hopefully close #63102.
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ext/tt/macro_rules.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs index 2a2df76d30c..81c5ef135b2 100644 --- a/src/libsyntax/ext/tt/macro_rules.rs +++ b/src/libsyntax/ext/tt/macro_rules.rs @@ -282,7 +282,10 @@ pub fn compile( quoted::TokenTree::Sequence( DelimSpan::dummy(), Lrc::new(quoted::SequenceRepetition { - tts: vec![quoted::TokenTree::token(token::Semi, def.span)], + tts: vec![quoted::TokenTree::token( + if body.legacy { token::Semi } else { token::Comma }, + def.span, + )], separator: None, kleene: quoted::KleeneToken::new(quoted::KleeneOp::ZeroOrMore, def.span), num_captures: 0, |
