syntax: Treat error literals in more principled way

This commit is contained in:
Vadim Petrochenkov 2019-06-07 12:53:33 +03:00
parent c1c60d292e
commit 2af47facc3
11 changed files with 33 additions and 27 deletions

View file

@ -714,7 +714,6 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
ExprKind::AddrOf(_, ref subexpression) | ExprKind::Unary(_, ref subexpression) => {
visitor.visit_expr(subexpression)
}
ExprKind::Lit(_) => {}
ExprKind::Cast(ref subexpression, ref typ) | ExprKind::Type(ref subexpression, ref typ) => {
visitor.visit_expr(subexpression);
visitor.visit_ty(typ)
@ -826,7 +825,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
ExprKind::TryBlock(ref body) => {
visitor.visit_block(body)
}
ExprKind::Err => {}
ExprKind::Lit(_) | ExprKind::Err => {}
}
visitor.visit_expr_post(expression)