]> git.lizzy.rs Git - rust.git/blobdiff - src/tools/clippy/clippy_lints/src/semicolon_if_nothing_returned.rs
Rollup merge of #91562 - dtolnay:asyncspace, r=Mark-Simulacrum
[rust.git] / src / tools / clippy / clippy_lints / src / semicolon_if_nothing_returned.rs
index c0e4914efe0bd1778a8ba68d4505c65048bdb310..0b3bbbc815580841e701e22d419e37e6ecc336e3 100644 (file)
@@ -29,6 +29,7 @@
     ///     println!("Hello world");
     /// }
     /// ```
+    #[clippy::version = "1.52.0"]
     pub SEMICOLON_IF_NOTHING_RETURNED,
     pedantic,
     "add a semicolon if nothing is returned"
@@ -44,7 +45,7 @@ fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) {
             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