1
Fork 0

Properly emit expected ; on #[attr] expr

This commit is contained in:
Lieselotte 2024-02-26 21:47:10 +01:00
parent 829308e9af
commit 1658ca082a
No known key found for this signature in database
GPG key ID: 43A6A32F83A6F9B1
5 changed files with 45 additions and 6 deletions

View file

@ -800,9 +800,8 @@ impl<'a> Parser<'a> {
{
Ok(next_attr) => next_attr,
Err(inner_err) => {
err.cancel();
inner_err.cancel();
return self.dcx().span_delayed_bug(expr.span, "not a tail expression");
return err.emit();
}
}
&& let ast::AttrKind::Normal(next_attr_kind) = next_attr.kind
@ -813,9 +812,8 @@ impl<'a> Parser<'a> {
let next_expr = match snapshot.parse_expr() {
Ok(next_expr) => next_expr,
Err(inner_err) => {
err.cancel();
inner_err.cancel();
return self.dcx().span_delayed_bug(expr.span, "not a tail expression");
return err.emit();
}
};
// We have for sure