Skip to content

Commit

Permalink
Rollup merge of rust-lang#87385 - Aaron1011:final-enable-semi, r=petr…
Browse files Browse the repository at this point in the history
…ochenkov

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.
  • Loading branch information
JohnTitor committed Jul 30, 2021
2 parents 2b20f49 + 967a721 commit 0af50b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/ui/needless_borrow_pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
fn f1(_: &str) {}
macro_rules! m1 {
($e:expr) => {
f1($e);
f1($e)
};
}
macro_rules! m3 {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/ref_binding_to_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
fn f1(_: &str) {}
macro_rules! m2 {
($e:expr) => {
f1(*$e);
f1(*$e)
};
}
macro_rules! m3 {
Expand Down

0 comments on commit 0af50b4

Please sign in to comment.