From d2d851949bab4c96b54d11126a0efd1826557d3f Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sat, 31 Jul 2021 06:09:54 +0900 Subject: Fix a parser ICE on invalid `fn` body --- compiler/rustc_parse/src/parser/item.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'compiler/rustc_parse/src/parser') diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs index 2ce63d011f4..1e4bc49cb39 100644 --- a/compiler/rustc_parse/src/parser/item.rs +++ b/compiler/rustc_parse/src/parser/item.rs @@ -1715,13 +1715,11 @@ impl<'a> Parser<'a> { // the AST for typechecking. err.span_label(ident.span, "while parsing this `fn`"); err.emit(); - (Vec::new(), None) } else { return Err(err); } - } else { - unreachable!() } + (Vec::new(), None) }; attrs.extend(inner_attrs); Ok(body) -- cgit 1.4.1-3-g733a5