1
Fork 0

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
This commit is contained in:
bors 2018-04-02 10:38:28 +00:00
commit 097efa9a99
16 changed files with 335 additions and 34 deletions

View file

@ -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),