Fix a parser ICE on invalid fn
body
This commit is contained in:
parent
f3f8e758f2
commit
d2d851949b
3 changed files with 29 additions and 3 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue