[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <DATDK117JU2W.3QRBUS95CFSAJ@kernel.org>
Date: Sun, 22 Jun 2025 23:20:17 +0200
From: "Benno Lossin" <lossin@...nel.org>
To: "Danilo Krummrich" <dakr@...nel.org>
Cc: <gregkh@...uxfoundation.org>, <rafael@...nel.org>, <ojeda@...nel.org>,
<alex.gaynor@...il.com>, <boqun.feng@...il.com>, <gary@...yguo.net>,
<bjorn3_gh@...tonmail.com>, <a.hindborg@...nel.org>,
<aliceryhl@...gle.com>, <tmgross@...ch.edu>, <david.m.ertman@...el.com>,
<ira.weiny@...el.com>, <leon@...nel.org>, <kwilczynski@...nel.org>,
<bhelgaas@...gle.com>, <rust-for-linux@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-pci@...r.kernel.org>
Subject: Re: [PATCH v2 4/4] rust: devres: implement register_release()
On Sun Jun 22, 2025 at 11:12 PM CEST, Danilo Krummrich wrote:
> On Sun, Jun 22, 2025 at 10:47:55PM +0200, Benno Lossin wrote:
>> On Sun Jun 22, 2025 at 6:40 PM CEST, Danilo Krummrich wrote:
>> > +impl<T: Release> Release for crate::sync::ArcBorrow<'_, T> {
>> > + fn release(&self) {
>> > + self.deref().release();
>> > + }
>> > +}
>> > +
>> > +impl<T: Release> Release for Pin<&'_ T> {
>>
>> You don't need the `'_` here.
>>
>> > + fn release(&self) {
>> > + self.deref().release();
>> > + }
>> > +}
>>
>> I still think we're missing a `impl<T: Release> Release for &T`.
>
> Yeah, I really thought the compile can figure this one out.
To me it makes perfect sense that it doesn't work, since `T: Release`,
but `&T: Release` is not satisfied.
Also a funny note: if you add the impl any number of `&` before the `T`
will implement `Release` :)
---
Cheers,
Benno
Powered by blists - more mailing lists