Add ErrorGuaranteed
to ast::ExprKind::Err
This commit is contained in:
parent
a3fce72a27
commit
c440a5b814
37 changed files with 660 additions and 602 deletions
|
@ -1296,7 +1296,7 @@ impl Expr {
|
|||
ExprKind::Yeet(..) => ExprPrecedence::Yeet,
|
||||
ExprKind::FormatArgs(..) => ExprPrecedence::FormatArgs,
|
||||
ExprKind::Become(..) => ExprPrecedence::Become,
|
||||
ExprKind::Err | ExprKind::Dummy => ExprPrecedence::Err,
|
||||
ExprKind::Err(_) | ExprKind::Dummy => ExprPrecedence::Err,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1518,7 +1518,7 @@ pub enum ExprKind {
|
|||
FormatArgs(P<FormatArgs>),
|
||||
|
||||
/// Placeholder for an expression that wasn't syntactically well formed in some way.
|
||||
Err,
|
||||
Err(ErrorGuaranteed),
|
||||
|
||||
/// Acts as a null expression. Lowering it will always emit a bug.
|
||||
Dummy,
|
||||
|
|
|
@ -1526,7 +1526,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
|
|||
}
|
||||
ExprKind::Try(expr) => vis.visit_expr(expr),
|
||||
ExprKind::TryBlock(body) => vis.visit_block(body),
|
||||
ExprKind::Lit(_) | ExprKind::IncludedBytes(..) | ExprKind::Err | ExprKind::Dummy => {}
|
||||
ExprKind::Lit(_) | ExprKind::IncludedBytes(..) | ExprKind::Err(_) | ExprKind::Dummy => {}
|
||||
}
|
||||
vis.visit_id(id);
|
||||
vis.visit_span(span);
|
||||
|
|
|
@ -89,7 +89,7 @@ pub fn expr_trailing_brace(mut expr: &ast::Expr) -> Option<&ast::Expr> {
|
|||
| Paren(_)
|
||||
| Try(_)
|
||||
| Yeet(None)
|
||||
| Err
|
||||
| Err(_)
|
||||
| Dummy => break None,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1063,7 +1063,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) -> V
|
|||
}
|
||||
ExprKind::Try(subexpression) => try_visit!(visitor.visit_expr(subexpression)),
|
||||
ExprKind::TryBlock(body) => try_visit!(visitor.visit_block(body)),
|
||||
ExprKind::Lit(_) | ExprKind::IncludedBytes(..) | ExprKind::Err | ExprKind::Dummy => {}
|
||||
ExprKind::Lit(_) | ExprKind::IncludedBytes(..) | ExprKind::Err(_) | ExprKind::Dummy => {}
|
||||
}
|
||||
|
||||
visitor.visit_expr_post(expression)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue