diff options
| author | Lieselotte <52315535+she3py@users.noreply.github.com> | 2024-02-25 22:22:11 +0100 |
|---|---|---|
| committer | Lieselotte <52315535+she3py@users.noreply.github.com> | 2024-02-25 22:24:31 +0100 |
| commit | ef2039effc824936a673cda3ae17ec926e686656 (patch) | |
| tree | b17e048865909aa59b3dd2ba4006574e2d4af8e6 | |
| parent | 66e475794d27f58d3fa6928c0c8858c42302379e (diff) | |
| download | rust-ef2039effc824936a673cda3ae17ec926e686656.tar.gz rust-ef2039effc824936a673cda3ae17ec926e686656.zip | |
Add `ErrorGuaranteed` to `ast::ExprKind::Err`
| -rw-r--r-- | clippy_utils/src/ast_utils.rs | 2 | ||||
| -rw-r--r-- | clippy_utils/src/sugg.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_utils/src/ast_utils.rs b/clippy_utils/src/ast_utils.rs index 81a26a12009..c52a4e0d8b7 100644 --- a/clippy_utils/src/ast_utils.rs +++ b/clippy_utils/src/ast_utils.rs @@ -143,7 +143,7 @@ pub fn eq_expr(l: &Expr, r: &Expr) -> bool { match (&l.kind, &r.kind) { (Paren(l), _) => 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), (Array(l), Array(r)) => over(l, r, |l, r| eq_expr(l, r)), diff --git a/clippy_utils/src/sugg.rs b/clippy_utils/src/sugg.rs index 7b1b0388b29..1f6446b8746 100644 --- a/clippy_utils/src/sugg.rs +++ b/clippy_utils/src/sugg.rs @@ -222,7 +222,7 @@ impl<'a> Sugg<'a> { | ast::ExprKind::Array(..) | ast::ExprKind::While(..) | ast::ExprKind::Await(..) - | ast::ExprKind::Err + | 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( AssocOp::DotDot, |
