about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-07-31 04:09:20 +0900
committerGitHub <noreply@github.com>2021-07-31 04:09:20 +0900
commit0af50b4d320750fb2b756e2b556237877e097872 (patch)
tree7723dd3d6400aebfda4cf889b9ee33364a2da79b
parent2b20f49841dbfb773d47c008b4278885435483ac (diff)
parent967a72196ccfcad10f91af72ddb7de600072c461 (diff)
downloadrust-0af50b4d320750fb2b756e2b556237877e097872.tar.gz
rust-0af50b4d320750fb2b756e2b556237877e097872.zip
Rollup merge of #87385 - Aaron1011:final-enable-semi, r=petrochenkov
Make `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` warn by default

This PR makes the `SEMICOLON_IN_EXPRESSIONS_FROM_MACROS` lint warn by default.

To avoid showing a large number of un-actionable warnings to users, we only enable the lint for macros defined in the same crate. This ensures that users will be able to fix the warning by simply removing a semicolon.

In the future, I'd like to enable this lint unconditionally, and eventually make it into a hard error in a future edition. This PR is a step towards that goal.
-rw-r--r--tests/ui/needless_borrow_pat.rs2
-rw-r--r--tests/ui/ref_binding_to_reference.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/tests/ui/needless_borrow_pat.rs b/tests/ui/needless_borrow_pat.rs
index f0926220755..7a8137778b4 100644
--- a/tests/ui/needless_borrow_pat.rs
+++ b/tests/ui/needless_borrow_pat.rs
@@ -7,7 +7,7 @@
 fn f1(_: &str) {}
 macro_rules! m1 {
     ($e:expr) => {
-        f1($e);
+        f1($e)
     };
 }
 macro_rules! m3 {
diff --git a/tests/ui/ref_binding_to_reference.rs b/tests/ui/ref_binding_to_reference.rs
index c7235e1c221..cd6db8ddc88 100644
--- a/tests/ui/ref_binding_to_reference.rs
+++ b/tests/ui/ref_binding_to_reference.rs
@@ -7,7 +7,7 @@
 fn f1(_: &str) {}
 macro_rules! m2 {
     ($e:expr) => {
-        f1(*$e);
+        f1(*$e)
     };
 }
 macro_rules! m3 {