mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Rollup merge of #63198 - rbartlensky:fix-macro-trailing-comma, r=petrochenkov
Allow trailing comma in macro 2.0 declarations. This should hopefully close #63102.
This commit is contained in:
commit
89dce46efd
@ -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,
|
||||
|
8
src/test/ui/macros/issue-63102.rs
Normal file
8
src/test/ui/macros/issue-63102.rs
Normal file
@ -0,0 +1,8 @@
|
||||
// check-pass
|
||||
|
||||
#![feature(decl_macro)]
|
||||
macro foo {
|
||||
() => {},
|
||||
}
|
||||
|
||||
fn main() {}
|
Loading…
Reference in New Issue
Block a user