Re: [PATCH] rust: irq: add support for request_irq()
From: Gary Guo
Date: Wed Jan 15 2025 - 06:38:53 EST
On Tue, 14 Jan 2025 15:57:57 -0300
Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx> wrote:
> >
> > It's not the pin_init! stuff, but the Opaque stuff. If it fails, then
> > it runs the destructor of Opaque<T>, which does *not* run the
> > destructor of T.
> >
> > Alice
>
> This is pretty unintuitive if you take into account trivial examples like
>
> ```
> struct Foo(T)
> ```
>
> Where dropping Foo drops T.
>
> Is there any reason why dropping Opaque<T> doesn’t behave similarly?
>
> — Daniel
`Opaque` means that "this is a blob of bytes and don't touch it". It
can be uninitialized, so no meaningful action can be performed when
it's dropped.
Best,
Gary