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