about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAustin Bonander <austin.bonander@gmail.com>2018-03-15 23:20:56 -0700
committerAustin Bonander <austin.bonander@gmail.com>2018-04-02 01:56:12 -0700
commit7c0124dd357650acb9b7115a408712ea281d8d22 (patch)
tree496bfd1527c0c074eb6a7b0d9e1b5c0dfe338f5b /src/libsyntax/parse
parent517f24025a04e09936a6d07dc5298ca2b9371329 (diff)
downloadrust-7c0124dd357650acb9b7115a408712ea281d8d22.tar.gz
rust-7c0124dd357650acb9b7115a408712ea281d8d22.zip
Expand attribute macros on statements and expressions.
Retains the `stmt_expr_attributes` feature requirement for attributes on expressions.

closes #41475
cc #38356
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 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<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),