From 8725fac6f3a9285d437bc3354f8ae09df757712b Mon Sep 17 00:00:00 2001 From: Ada Alakbarova Date: Tue, 12 Aug 2025 19:36:03 +0200 Subject: [PATCH] misc: use `Ty::is_unit` --- clippy_lints/src/unnecessary_semicolon.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/unnecessary_semicolon.rs b/clippy_lints/src/unnecessary_semicolon.rs index 3d660a267a6b..76e24b6bf805 100644 --- a/clippy_lints/src/unnecessary_semicolon.rs +++ b/clippy_lints/src/unnecessary_semicolon.rs @@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessarySemicolon { expr.kind, ExprKind::If(..) | ExprKind::Match(_, _, MatchSource::Normal | MatchSource::Postfix) ) - && cx.typeck_results().expr_ty(expr) == cx.tcx.types.unit + && cx.typeck_results().expr_ty(expr).is_unit() // if a stmt has attrs, then turning it into an expr will break the code, since attrs aren't allowed on exprs && cx.tcx.hir_attrs(stmt.hir_id).is_empty() {