From 7c0124dd357650acb9b7115a408712ea281d8d22 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Thu, 15 Mar 2018 23:20:56 -0700 Subject: Expand attribute macros on statements and expressions. Retains the `stmt_expr_attributes` feature requirement for attributes on expressions. closes #41475 cc #38356 --- src/libsyntax/parse/parser.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b4b21285d3b..262198b6b15 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4601,6 +4601,9 @@ impl<'a> Parser<'a> { /// Parse a statement, including the trailing semicolon. pub fn parse_full_stmt(&mut self, macro_legacy_warnings: bool) -> PResult<'a, Option> { + // skip looking for a trailing semicolon when we have an interpolated statement + maybe_whole!(self, NtStmt, |x| Some(x)); + let mut stmt = match self.parse_stmt_without_recovery(macro_legacy_warnings)? { Some(stmt) => stmt, None => return Ok(None), -- cgit 1.4.1-3-g733a5