Skip to content

Commit

Permalink
Merge pull request #1004 from dtolnay/blockattr
Browse files Browse the repository at this point in the history
Parse outer attrs on ExprBlock
  • Loading branch information
dtolnay committed Mar 29, 2021
2 parents ee66f12 + 310df0c commit 359297f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2614,6 +2614,7 @@ pub(crate) mod parsing {
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
impl Parse for ExprBlock {
fn parse(input: ParseStream) -> Result<Self> {
let outer_attrs = input.call(Attribute::parse_outer)?;
let label: Option<Label> = input.parse()?;

let content;
Expand All @@ -2622,7 +2623,7 @@ pub(crate) mod parsing {
let stmts = content.call(Block::parse_within)?;

Ok(ExprBlock {
attrs: inner_attrs,
attrs: private::attrs(outer_attrs, inner_attrs),
label,
block: Block { brace_token, stmts },
})
Expand Down

0 comments on commit 359297f

Please sign in to comment.