Document MacCall special case in Parser::parse_arm
This commit is contained in:
parent
9dbe33d256
commit
728e117166
1 changed files with 11 additions and 0 deletions
|
@ -3182,6 +3182,17 @@ impl<'a> Parser<'a> {
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
let require_comma = match expr.kind {
|
let require_comma = match expr.kind {
|
||||||
|
// Special case: braced macro calls require comma in a match
|
||||||
|
// arm, even though they do not require semicolon in a
|
||||||
|
// statement.
|
||||||
|
//
|
||||||
|
// m! {} // okay without semicolon
|
||||||
|
//
|
||||||
|
// match ... {
|
||||||
|
// _ => m! {}, // requires comma
|
||||||
|
// _ => ...
|
||||||
|
// }
|
||||||
|
//
|
||||||
ExprKind::MacCall(_) => true,
|
ExprKind::MacCall(_) => true,
|
||||||
_ => classify::expr_requires_semi_to_be_stmt(&expr),
|
_ => classify::expr_requires_semi_to_be_stmt(&expr),
|
||||||
} && this.token != token::CloseDelim(Delimiter::Brace);
|
} && this.token != token::CloseDelim(Delimiter::Brace);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue