semicolon_in_expressions_from_macros: Lint on non-local macros too#159222
Conversation
The `semicolon_in_expressions_from_macros` lint previously suppressed warnings about non-local macros. This masks a lint that will subsequently become a hard error. Stop suppressing it, dropping the `is_local` flag and check. Fix the test for this case to now expect the error. Drop a separate test that depended on the lack of error (and that specifically notes it should be dropped once the lint becomes a hard error).
|
rustbot has assigned @hanna-kruppe. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
@bors r+ |
|
Probably deserves to be on the releases notes. @rustbot label +relnotes |
This comment has been minimized.
This comment has been minimized.
semicolon_in_expressions_from_macros: Lint on non-local macros too The `semicolon_in_expressions_from_macros` lint previously suppressed warnings about non-local macros. This masks a lint that will subsequently become a hard error. Stop suppressing it, dropping the `is_local` flag and check. Fix the test for this case to now expect the error. Drop a separate test that depended on the lack of error (and that specifically notes it should be dropped once the lint becomes a hard error).
…uwer Rollup of 13 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #156712 (Pointer authentication config and user facing options) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #156609 (Consider structurally impossible Sized predicates in MIR) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
semicolon_in_expressions_from_macros: Lint on non-local macros too The `semicolon_in_expressions_from_macros` lint previously suppressed warnings about non-local macros. This masks a lint that will subsequently become a hard error. Stop suppressing it, dropping the `is_local` flag and check. Fix the test for this case to now expect the error. Drop a separate test that depended on the lack of error (and that specifically notes it should be dropped once the lint becomes a hard error).
…uwer Rollup of 14 pull requests Successful merges: - #159039 (resolve: fix effective visibilities for items in ambiguous glob sets) - #157706 (Deny `todo!()` in tidy) - #158535 (Support `#[track_caller]` on EII declarations) - #158632 (First steps of late-bound turbofishing (place FnDef behind a dummy binder)) - #158846 (Fix unused variable warnings for diverging expressions) - #159002 (Small refactorings in `need_type_info` module) - #159202 (Bump rustc-demangle to 0.1.28) - #159216 (Avoid using probe self_ty for delegation arguments) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #156609 (Consider structurally impossible Sized predicates in MIR) - #157993 (Expose more info about ADTs and functions in rustc_public) - #158854 (Add `#[rustc_test_entrypoint_marker]`) - #158998 (Some minor ast validation and visiting cleanups) - #159123 (doc: clarify attr parser APIs)
|
💔 I suspect this PR failed tests as part of a rollup After fixing the problem, consider running a try job for the failed job before re-approving. |
|
This pull request was unapproved. This PR was contained in a rollup (#159236), which was unapproved. |
|
I wasn't expecting this to get r+ed and get pulled into rollups before it passed CI. I'll work on fixing the failures. |
|
Looks potentially spurious. @bors try jobs=test-various |
This comment has been minimized.
This comment has been minimized.
semicolon_in_expressions_from_macros: Lint on non-local macros too try-job: test-various
|
@rustbot ready |
|
@bors r+ |
…uwer Rollup of 8 pull requests Successful merges: - #159197 (Rename ModDefId to ModId and use more) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #159296 (Implement `bool::toggle`) - #158302 (Fix `overflowing_literals` lint with repeated negation) - #158484 (Add documentation for the `cold` and `track_caller` attributes) - #159239 (Add codegen test for remainder match) - #159330 (fix some edition annotations in UI tests) - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs) Failed merges: - #158962 (Add `proc_macro` attribute documentation)
…uwer Rollup of 8 pull requests Successful merges: - #159197 (Rename ModDefId to ModId and use more) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #159296 (Implement `bool::toggle`) - #158302 (Fix `overflowing_literals` lint with repeated negation) - #158484 (Add documentation for the `cold` and `track_caller` attributes) - #159239 (Add codegen test for remainder match) - #159330 (fix some edition annotations in UI tests) - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs) Failed merges: - #158962 (Add `proc_macro` attribute documentation)
…uwer Rollup of 8 pull requests Successful merges: - #159197 (Rename ModDefId to ModId and use more) - #159222 (semicolon_in_expressions_from_macros: Lint on non-local macros too) - #159296 (Implement `bool::toggle`) - #158302 (Fix `overflowing_literals` lint with repeated negation) - #158484 (Add documentation for the `cold` and `track_caller` attributes) - #159239 (Add codegen test for remainder match) - #159330 (fix some edition annotations in UI tests) - #159331 (Fix ignore-llvm-version directive in codegen-llvm/array-equality.rs) Failed merges: - #158962 (Add `proc_macro` attribute documentation)
Rollup merge of #159222 - joshtriplett:main, r=petrochenkov semicolon_in_expressions_from_macros: Lint on non-local macros too The `semicolon_in_expressions_from_macros` lint previously suppressed warnings about non-local macros. This masks a lint that will subsequently become a hard error. Stop suppressing it, dropping the `is_local` flag and check. Fix the test for this case to now expect the error. Drop a separate test that depended on the lack of error (and that specifically notes it should be dropped once the lint becomes a hard error).
These macros are used like expressions, so they should not emit a
semicolon. This is being turned into a hard error in a future release of
Rust.
error: trailing semicolon in macro used in expression position
--> drivers/gpu/nova-core/firmware/fsp.rs:79:34
|
79 | .inspect_err(|_| dev_err!(dev, "FMC firmware missing '{}' section\n", name))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79813 <rust-lang/rust#79813>
= note: this error originates in the macro `dev_err` (in Nightly builds, run with -Z macro-backtrace for more info)
[ I was doubly surprised since upstream made it a deny-by-default lint
a year ago for Rust 1.91.0, and yet we didn't see it; plus I hadn't
seen this in my CI even yesterday.
It turns out this just landed into today's nightly (nightly-2026-07-16,
using upstream commit d0babd8b6):
Link: rust-lang/rust#159222
which says:
"The `semicolon_in_expressions_from_macros` lint previously
suppressed warnings about non-local macros. This masks
a lint that will subsequently become a hard error."
So that explains it. And this is the PR that will make it a hard error
at some point in the future:
Link: rust-lang/rust#159218
Thus starting with Rust 1.99.0 (expected 2026-10-01), we will be
seeing the deny-by-default lint above, so clean it up already.
- Miguel ]
Cc: stable@vger.kernel.org # Needed in 6.18.y and later.
Link: rust-lang/rust#79813
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: rust-lang/rust#159218
Link: rust-lang/rust#159222
Link: https://patch.msgid.link/20260716-device-trail-semicolon-v1-1-f48e9dcfae15@google.com
[ Fixed typo. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
|
Just FYI, this is hitting popular crates like |
|
(Interestingly, the reports are blaming nix, but the actual issue is in the cfg_aliases crate.) |
The latest nightly has started to warn that `nix` will break in the future due to `semicolon_in_expressions_from_macros`. The actual issue is related to `cfg_aliases`, which was affected by rust-lang/rust#159222.
The latest nightly has started to warn that `nix` will break in the future due to `semicolon_in_expressions_from_macros`. The actual issue is related to `cfg_aliases`, which was affected by rust-lang/rust#159222.
These macros are used like expressions, so they should not emit a
semicolon. This is being turned into a hard error in a future release of
Rust.
error: trailing semicolon in macro used in expression position
--> drivers/gpu/nova-core/firmware/fsp.rs:79:34
|
79 | .inspect_err(|_| dev_err!(dev, "FMC firmware missing '{}' section\n", name))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #79813 <rust-lang/rust#79813>
= note: this error originates in the macro `dev_err` (in Nightly builds, run with -Z macro-backtrace for more info)
[ I was doubly surprised since upstream made it a deny-by-default lint
a year ago for Rust 1.91.0, and yet we didn't see it; plus I hadn't
seen this in my CI even yesterday.
It turns out this just landed into today's nightly (nightly-2026-07-16,
using upstream commit d0babd8b6):
Link: rust-lang/rust#159222
which says:
"The `semicolon_in_expressions_from_macros` lint previously
suppressed warnings about non-local macros. This masks
a lint that will subsequently become a hard error."
So that explains it. And this is the PR that will make it a hard error
at some point in the future:
Link: rust-lang/rust#159218
Thus starting with Rust 1.99.0 (expected 2026-10-01), we will be
seeing the deny-by-default lint above, so clean it up already.
- Miguel ]
Cc: stable@vger.kernel.org # Needed in 6.18.y and later.
Link: rust-lang/rust#79813
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Gary Guo <gary@garyguo.net>
Acked-by: Danilo Krummrich <dakr@kernel.org>
Link: rust-lang/rust#159218
Link: rust-lang/rust#159222
Link: https://patch.msgid.link/20260716-device-trail-semicolon-v1-1-f48e9dcfae15@google.com
[ Fixed typo. ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
View all comments
The
semicolon_in_expressions_from_macroslint previously suppressedwarnings about non-local macros. This masks a lint that will
subsequently become a hard error.
Stop suppressing it, dropping the
is_localflag and check.Fix the test for this case to now expect the error. Drop a separate test
that depended on the lack of error (and that specifically notes it
should be dropped once the lint becomes a hard error).