diff options
| author | bors <bors@rust-lang.org> | 2017-07-29 23:01:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-07-29 23:01:45 +0000 |
| commit | 53bf7903fa7ebabca85f5937667956177989e345 (patch) | |
| tree | ec30eabce66b14bc4412ea97e3537ce975fed1c3 /src/libsyntax/parse | |
| parent | cfe1668ca3ddb3dc57b1af319e258a16664486fa (diff) | |
| parent | 3142ca0a6562ecf4653e2f1b1da19de6270322ec (diff) | |
| download | rust-53bf7903fa7ebabca85f5937667956177989e345.tar.gz rust-53bf7903fa7ebabca85f5937667956177989e345.zip | |
Auto merge of #43009 - GuillaumeGomez:unused-doc-comments, r=nrc
Throw errors when doc comments are added where they're unused #42617
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 1a10aa9d621..1cb5a8111dc 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2074,14 +2074,14 @@ impl<'a> Parser<'a> { } else { Ok(self.mk_expr(span, ExprKind::Tup(es), attrs)) } - }, + } token::OpenDelim(token::Brace) => { return self.parse_block_expr(lo, BlockCheckMode::Default, attrs); - }, - token::BinOp(token::Or) | token::OrOr => { + } + token::BinOp(token::Or) | token::OrOr => { let lo = self.span; return self.parse_lambda_expr(lo, CaptureBy::Ref, attrs); - }, + } token::OpenDelim(token::Bracket) => { self.bump(); @@ -2329,7 +2329,6 @@ impl<'a> Parser<'a> { pub fn parse_block_expr(&mut self, lo: Span, blk_mode: BlockCheckMode, outer_attrs: ThinVec<Attribute>) -> PResult<'a, P<Expr>> { - self.expect(&token::OpenDelim(token::Brace))?; let mut attrs = outer_attrs; |
