From a003ca6853772ccde7f4af6d3178126120093cc4 Mon Sep 17 00:00:00 2001 From: dswij Date: Wed, 10 Nov 2021 14:46:00 +0800 Subject: [PATCH] `semicolon_if_nothing_returned` now checks if the stmt ends with semicolon --- clippy_lints/src/semicolon_if_nothing_returned.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clippy_lints/src/semicolon_if_nothing_returned.rs b/clippy_lints/src/semicolon_if_nothing_returned.rs index c0e4914efe0b..d3b4929a1892 100644 --- a/clippy_lints/src/semicolon_if_nothing_returned.rs +++ b/clippy_lints/src/semicolon_if_nothing_returned.rs @@ -44,7 +44,7 @@ impl LateLintPass<'_> for SemicolonIfNothingReturned { let t_expr = cx.typeck_results().expr_ty(expr); if t_expr.is_unit(); if let snippet = snippet_with_macro_callsite(cx, expr.span, "}"); - if !snippet.ends_with('}'); + if !snippet.ends_with('}') && !snippet.ends_with(';'); if cx.sess().source_map().is_multiline(block.span); then { // filter out the desugared `for` loop