about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser/diagnostics.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-10-28 01:21:24 +0100
committerGitHub <noreply@github.com>2020-10-28 01:21:24 +0100
commit892ebe9afe9d299a5ff22b9dec1a84a653b85f78 (patch)
tree9e0ee9377cbb36f710bfceb062aa74cf39249ab4 /compiler/rustc_parse/src/parser/diagnostics.rs
parent1a64e570c6d3bf19a387f96bcb0bd09e51caee22 (diff)
parentff61949860813247b26d96eb374b41b46becba81 (diff)
downloadrust-892ebe9afe9d299a5ff22b9dec1a84a653b85f78.tar.gz
rust-892ebe9afe9d299a5ff22b9dec1a84a653b85f78.zip
Rollup merge of #78379 - estebank:fn-signature-parse, r=varkor
Tweak invalid `fn` header and body parsing

* Rely on regular "expected"/"found" parser error for `fn`, fix #77115
* Recover empty `fn` bodies when encountering `}`
* Recover trailing `>` in return types
* Recover from non-type in array type `[<BAD TOKEN>; LEN]`
Diffstat (limited to 'compiler/rustc_parse/src/parser/diagnostics.rs')
-rw-r--r--compiler/rustc_parse/src/parser/diagnostics.rs8
1 files changed, 0 insertions, 8 deletions
diff --git a/compiler/rustc_parse/src/parser/diagnostics.rs b/compiler/rustc_parse/src/parser/diagnostics.rs
index 012940a2ebb..730c16aba8c 100644
--- a/compiler/rustc_parse/src/parser/diagnostics.rs
+++ b/compiler/rustc_parse/src/parser/diagnostics.rs
@@ -1557,14 +1557,6 @@ impl<'a> Parser<'a> {
         }
     }
 
-    pub(super) fn expected_semi_or_open_brace<T>(&mut self) -> PResult<'a, T> {
-        let token_str = super::token_descr(&self.token);
-        let msg = &format!("expected `;` or `{{`, found {}", token_str);
-        let mut err = self.struct_span_err(self.token.span, msg);
-        err.span_label(self.token.span, "expected `;` or `{`");
-        Err(err)
-    }
-
     pub(super) fn eat_incorrect_doc_comment_for_param_type(&mut self) {
         if let token::DocComment(..) = self.token.kind {
             self.struct_span_err(