[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z4cFO5NIW-E07Vl5@boqun-archlinux>
Date: Tue, 14 Jan 2025 16:45:47 -0800
From: Boqun Feng <boqun.feng@...il.com>
To: Daniel Almeida <daniel.almeida@...labora.com>
Cc: Alice Ryhl <aliceryhl@...gle.com>, Miguel Ojeda <ojeda@...nel.org>,
Alex Gaynor <alex.gaynor@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Benno Lossin <benno.lossin@...ton.me>,
Andreas Hindborg <a.hindborg@...nel.org>,
Trevor Gross <tmgross@...ch.edu>, linux-kernel@...r.kernel.org,
rust-for-linux@...r.kernel.org
Subject: Re: [PATCH] rust: irq: add support for request_irq()
On Tue, Jan 14, 2025 at 03:57:57PM -0300, Daniel Almeida 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?
>
Because `Opaque` implies the value may not be initialized, it's similar
to `MaybeUninit`.
Do you really need the `Opaque` here? C code won't touch `handler` if
I'm not missing anything.
Regards,
Boqun
> — Daniel
Powered by blists - more mailing lists