Skip to content

Commit

Permalink
Parse outer attrs on ExprBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Mar 29, 2021
1 parent ee66f12 commit 310df0c
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 310df0c

Please sign in to comment.