Add ast::ExprKind::Dummy
This commit is contained in:
parent
31b551fee9
commit
66e475794d
@ -144,6 +144,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool {
|
|||||||
(Paren(l), _) => eq_expr(l, r),
|
(Paren(l), _) => eq_expr(l, r),
|
||||||
(_, Paren(r)) => eq_expr(l, r),
|
(_, Paren(r)) => eq_expr(l, r),
|
||||||
(Err, Err) => true,
|
(Err, Err) => true,
|
||||||
|
(Dummy, _) | (_, Dummy) => unreachable!("comparing `ExprKind::Dummy`"),
|
||||||
(Try(l), Try(r)) | (Await(l, _), Await(r, _)) => eq_expr(l, r),
|
(Try(l), Try(r)) | (Await(l, _), Await(r, _)) => eq_expr(l, r),
|
||||||
(Array(l), Array(r)) => over(l, r, |l, r| eq_expr(l, r)),
|
(Array(l), Array(r)) => over(l, r, |l, r| eq_expr(l, r)),
|
||||||
(Tup(l), Tup(r)) => over(l, r, |l, r| eq_expr(l, r)),
|
(Tup(l), Tup(r)) => over(l, r, |l, r| eq_expr(l, r)),
|
||||||
|
@ -222,7 +222,8 @@ pub fn ast(
|
|||||||
| ast::ExprKind::Array(..)
|
| ast::ExprKind::Array(..)
|
||||||
| ast::ExprKind::While(..)
|
| ast::ExprKind::While(..)
|
||||||
| ast::ExprKind::Await(..)
|
| ast::ExprKind::Await(..)
|
||||||
| ast::ExprKind::Err => Sugg::NonParen(snippet_with_context(cx, expr.span, ctxt, default, app).0),
|
| ast::ExprKind::Err
|
||||||
|
| ast::ExprKind::Dummy => Sugg::NonParen(snippet_with_context(cx, expr.span, ctxt, default, app).0),
|
||||||
ast::ExprKind::Range(ref lhs, ref rhs, RangeLimits::HalfOpen) => Sugg::BinOp(
|
ast::ExprKind::Range(ref lhs, ref rhs, RangeLimits::HalfOpen) => Sugg::BinOp(
|
||||||
AssocOp::DotDot,
|
AssocOp::DotDot,
|
||||||
lhs.as_ref().map_or("".into(), |lhs| {
|
lhs.as_ref().map_or("".into(), |lhs| {
|
||||||
|
Loading…
Reference in New Issue
Block a user