diff options
| author | bors <bors@rust-lang.org> | 2017-08-31 23:26:47 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-08-31 23:26:47 +0000 |
| commit | 69dbe6602ddc32dad1febb65232c999dd9980ead (patch) | |
| tree | e4766f3114bc7f60d01489fc6621039feded8323 /src/libsyntax/parse | |
| parent | 97b01abf3d222523d0db4f79c13ed45e7fef27e3 (diff) | |
| parent | 7054fe309445d6c9275b87a40ba2122b321b5a31 (diff) | |
| download | rust-69dbe6602ddc32dad1febb65232c999dd9980ead.tar.gz rust-69dbe6602ddc32dad1febb65232c999dd9980ead.zip | |
Auto merge of #43425 - matklad:lambda-restrictions, r=eddyb
Lambda expressions honor no struct literal restriction This is a fix for #43412 if we decide that it is indeed a bug :) closes #43412
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5e05f36345f..d08373334f1 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3025,7 +3025,10 @@ impl<'a> Parser<'a> { let decl = self.parse_fn_block_decl()?; let decl_hi = self.prev_span; let body = match decl.output { - FunctionRetTy::Default(_) => self.parse_expr()?, + FunctionRetTy::Default(_) => { + let restrictions = self.restrictions - RESTRICTION_STMT_EXPR; + self.parse_expr_res(restrictions, None)? + }, _ => { // If an explicit return type is given, require a // block to appear (RFC 968). |
