Skip to content

Commit

Permalink
Merge pull request #1010 from dtolnay/exprparse
Browse files Browse the repository at this point in the history
impl Parse for ExprClosure
  • Loading branch information
dtolnay committed Apr 1, 2021
2 parents e899ca5 + 88ac502 commit 1f7bc27
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/expr.rs
Expand Up @@ -2241,7 +2241,6 @@ pub(crate) mod parsing {
ExprBinary, Binary, "expected binary operation",
ExprCast, Cast, "expected cast expression",
ExprType, Type, "expected type ascription expression",
ExprClosure, Closure, "expected closure expression",
ExprAssign, Assign, "expected assignment expression",
ExprAssignOp, AssignOp, "expected compound assignment expression",
ExprField, Field, "expected struct field access",
Expand Down Expand Up @@ -2301,6 +2300,15 @@ pub(crate) mod parsing {
})
}

#[cfg(feature = "full")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
impl Parse for ExprClosure {
fn parse(input: ParseStream) -> Result<Self> {
let allow_struct = AllowStruct(true);
expr_closure(input, allow_struct)
}
}

#[cfg(feature = "full")]
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
impl Parse for ExprTryBlock {
Expand Down

0 comments on commit 1f7bc27

Please sign in to comment.