Re: [PATCH] rust: device: avoid trailing ; in printing macros

From: Miguel Ojeda

Date: Thu Jul 16 2026 - 08:18:37 EST


On Thu, Jul 16, 2026 at 12:22 PM Alice Ryhl <aliceryhl@xxxxxxxxxx> wrote:
>
> These macros are used like expressions, so they should must 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 <https://github.com/rust-lang/rust/issues/79813>
> = note: this error originates in the macro `dev_err` (in Nightly builds, run with -Z macro-backtrace for more info)
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 5c7ca6fa603f ("rust: add `dev_*` print macros.")
> Link: https://github.com/rust-lang/rust/issues/79813
> Signed-off-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>

I was doubly surprised since upstream made it a warning by default a
long time ago, and yet we didn't see it; and since I hadn't seen in my
CI even yesterday.

It turns out this just landed into today's nightly:

Link: https://github.com/rust-lang/rust/pull/159222

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 one that will make it a hard error:

Link: https://github.com/rust-lang/rust/pull/159218

Ok, I will land this into `rust-fixes` then, and send the PR during
the weekend after tomorrow's -next.

Cheers,
Miguel