diff options
| author | Yuki Okushi <yuki.okushi@huawei.com> | 2021-07-31 06:09:54 +0900 |
|---|---|---|
| committer | Yuki Okushi <yuki.okushi@huawei.com> | 2021-07-31 06:09:54 +0900 |
| commit | d2d851949bab4c96b54d11126a0efd1826557d3f (patch) | |
| tree | 3e8393a6f4eba91ef540c48e6ec7a0c1a687e149 /compiler/rustc_parse/src/parser | |
| parent | f3f8e758f2b2abd84b76bcb4ec0b6ae263e1e7b9 (diff) | |
| download | rust-d2d851949bab4c96b54d11126a0efd1826557d3f.tar.gz rust-d2d851949bab4c96b54d11126a0efd1826557d3f.zip | |
Fix a parser ICE on invalid `fn` body
Diffstat (limited to 'compiler/rustc_parse/src/parser')
| -rw-r--r-- | compiler/rustc_parse/src/parser/item.rs | 4 |
1 files changed, 1 insertions, 3 deletions
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) |
