From: Alice Ryhl <aliceryhl@google.com>
To: Gary Guo <gary@garyguo.net>
Cc: Deborah Brouwer <deborah.brouwer@collabora.com>,
dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org,
daniel.almeida@collabora.com, boris.brezillon@collabora.com,
broonie@kernel.org, dakr@kernel.org,
miguel.ojeda.sandonis@gmail.com
Subject: Re: [PATCH] drm/tyr: suppress unread field warnings
Date: Fri, 23 Jan 2026 09:18:55 +0000 [thread overview]
Message-ID: <aXM8_-8trM6FqQWu@google.com> (raw)
In-Reply-To: <DFVDAEMXT9LT.YCUH2BB8FV7C@garyguo.net>
On Thu, Jan 22, 2026 at 07:32:55PM +0000, Gary Guo wrote:
> On Thu Jan 22, 2026 at 8:42 AM GMT, Alice Ryhl wrote:
> > On Wed, Jan 21, 2026 at 04:37:46PM -0800, Deborah Brouwer wrote:
> >> #[pin_data]
> >> struct Regulators {
> >> + #[allow(dead_code)]
> >> mali: Regulator<regulator::Enabled>,
> >> + #[allow(dead_code)]
> >> sram: Regulator<regulator::Enabled>,
> >
> > I don't think we intend to ever use these fields - they exist only for
> > their destructor. In that case, please prefix them with an underscore
> > instead:
> >
> > #[pin_data]
> > struct Regulators {
> > _mali: Regulator<regulator::Enabled>,
> > _sram: Regulator<regulator::Enabled>,
> > }
>
> I wonder if it makes sense to request a feature to mute `dead_code` lint on
> certain types which we know are there to represent a registration or resource
> enablement.
>
> Currently rustc's dead_code lint has a builtin exception for `PhantomData`, but
> I think a lot other types should have the same treatment, this can be useful
> even for other core types, e.g `PhantomPinned`.
That'd be an interesting rustc feature. I don't think it's possible
today.
Alice
next prev parent reply other threads:[~2026-01-23 9:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-22 0:37 [PATCH] drm/tyr: suppress unread field warnings Deborah Brouwer
2026-01-22 0:58 ` Miguel Ojeda
2026-01-22 2:11 ` Deborah Brouwer
2026-01-22 11:22 ` Mark Brown
2026-01-22 19:46 ` Danilo Krummrich
2026-01-23 15:01 ` Miguel Ojeda
2026-01-23 15:10 ` Alice Ryhl
2026-01-23 15:24 ` Miguel Ojeda
2026-01-23 16:56 ` Gary Guo
2026-01-24 13:14 ` Miguel Ojeda
2026-01-22 8:42 ` Alice Ryhl
2026-01-22 19:05 ` Deborah Brouwer
2026-01-23 12:08 ` Alice Ryhl
2026-01-22 19:32 ` Gary Guo
2026-01-23 9:18 ` Alice Ryhl [this message]
2026-01-23 13:36 ` Miguel Ojeda
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=aXM8_-8trM6FqQWu@google.com \
--to=aliceryhl@google.com \
--cc=boris.brezillon@collabora.com \
--cc=broonie@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=deborah.brouwer@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gary@garyguo.net \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=rust-for-linux@vger.kernel.org \
/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