about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-02 10:38:28 +0000
committerbors <bors@rust-lang.org>2018-04-02 10:38:28 +0000
commit097efa9a998d4f3a4aee3af126e8f8a9eba1ae07 (patch)
treef213dd0246f87b52a73f2b1e3a5294382c2bdc3a /src/libsyntax/parse
parent135f334e0a3177146f7417cee7ceaf405ffe732d (diff)
parent7c0124dd357650acb9b7115a408712ea281d8d22 (diff)
downloadrust-097efa9a998d4f3a4aee3af126e8f8a9eba1ae07.tar.gz
rust-097efa9a998d4f3a4aee3af126e8f8a9eba1ae07.zip
Auto merge of #49124 - abonander:attr-macro-stmt-expr, r=abonander
Expand Attributes on Statements and Expressions

This enables attribute-macro expansion on statements and expressions while retaining the `stmt_expr_attributes` feature requirement for attributes on expressions.

closes #41475
cc #38356  @petrochenkov @jseyfried
r? @nrc
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 167795e4129..f7cdd4ba2b4 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<Stmt>> {
+        // 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),