From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Benno Lossin <lossin@kernel.org>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
"Sasha Levin" <sashal@kernel.org>,
"Alex Gaynor" <alex.gaynor@gmail.com>,
stable@vger.kernel.org, "Boqun Feng" <boqun.feng@gmail.com>,
"Gary Guo" <gary@garyguo.net>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <benno.lossin@proton.me>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Alice Ryhl" <aliceryhl@google.com>,
"Trevor Gross" <tmgross@umich.edu>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
patches@lists.linux.dev
Subject: Re: [PATCH 6.12.y] rust: init: allow `dead_code` warnings for Rust >= 1.89.0
Date: Sun, 13 Jul 2025 16:41:56 +0200 [thread overview]
Message-ID: <2025071348-jogger-clarity-641c@gregkh> (raw)
In-Reply-To: <DBA9X9FU5M9A.14RBXD887DKB1@kernel.org>
On Sat, Jul 12, 2025 at 08:04:48PM +0200, Benno Lossin wrote:
> On Sat Jul 12, 2025 at 7:10 PM CEST, Miguel Ojeda wrote:
> > Starting with Rust 1.89.0 (expected 2025-08-07), the Rust compiler
> > may warn:
> >
> > error: trait `MustNotImplDrop` is never used
> > --> rust/kernel/init/macros.rs:927:15
> > |
> > 927 | trait MustNotImplDrop {}
> > | ^^^^^^^^^^^^^^^
> > |
> > ::: rust/kernel/sync/arc.rs:133:1
> > |
> > 133 | #[pin_data]
> > | ----------- in this procedural macro expansion
> > |
> > = note: `-D dead-code` implied by `-D warnings`
> > = help: to override `-D warnings` add `#[allow(dead_code)]`
> > = note: this error originates in the macro `$crate::__pin_data`
> > which comes from the expansion of the attribute macro
> > `pin_data` (in Nightly builds, run with
> > -Z macro-backtrace for more info)
> >
> > Thus `allow` it to clean it up.
>
> This is a bit strange, I can't directly reproduce the issue... I already
> get this warning in 1.88:
>
> https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=465f71a848e77ac3f7a96a0af6bc9e2a
>
> > This does not happen in mainline nor 6.15.y, because there the macro was
> > moved out of the `kernel` crate, and `dead_code` warnings are not
> > emitted if the macro is foreign to the crate. Thus this patch is
> > directly sent to stable and intended for 6.12.y only.
> >
> > Similarly, it is not needed in previous LTSs, because there the Rust
> > version is pinned.
> >
> > Cc: Benno Lossin <lossin@kernel.org>
> > Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
>
> Anyways the patch itself looks fine, nobody should care about the
> dead-code warning (since it is in fact used to prevent `Drop` being
> implemented).
>
> Acked-by: Benno Lossin <lossin@kernel.org>
Thanks, now queued up.
greg k-h
prev parent reply other threads:[~2025-07-13 14:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-12 17:10 [PATCH 6.12.y] rust: init: allow `dead_code` warnings for Rust >= 1.89.0 Miguel Ojeda
2025-07-12 18:04 ` Benno Lossin
2025-07-13 14:41 ` Greg Kroah-Hartman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2025071348-jogger-clarity-641c@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=a.hindborg@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=benno.lossin@proton.me \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun.feng@gmail.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=patches@lists.linux.dev \
--cc=rust-for-linux@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tmgross@umich.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox