From cefbf4d7b57975a7d0e247e2bf3effaf4ec47333 Mon Sep 17 00:00:00 2001 From: Robert Bartlensky Date: Thu, 1 Aug 2019 21:07:47 +0100 Subject: [PATCH] Allow trailing comma in macro 2.0 declarations. --- src/libsyntax/ext/tt/macro_rules.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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,