From: Alice Ryhl <aliceryhl@google.com>
To: Gary Guo <gary@garyguo.net>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Carlos Llamas" <cmllamas@google.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
"Benno Lossin" <lossin@kernel.org>,
"Andreas Hindborg" <a.hindborg@kernel.org>,
"Trevor Gross" <tmgross@umich.edu>,
"Danilo Krummrich" <dakr@kernel.org>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] rust: sync: implement == operator for ARef
Date: Thu, 19 Feb 2026 14:34:21 +0000 [thread overview]
Message-ID: <aZcfbRS6cZuKykkV@google.com> (raw)
In-Reply-To: <0655a26e89c960d73888dcfed70645ec@garyguo.net>
On Thu, Feb 19, 2026 at 02:27:38PM +0000, Gary Guo wrote:
> On 2026-02-19 13:52, Alice Ryhl wrote:
> > Rust Binder wants to perform a comparison between ARef<Task> and &Task,
> > so define the == operator for ARef<_> when compared with another ARef<_>
> > or just a reference. The operator is implemented in terms of the same
> > operator applied to the inner type.
> >
> > Signed-off-by: Alice Ryhl <aliceryhl@google.com>
>
> I suppose `PartialEq<U>` cannot be implemented due to trait coherence issue?
That's right:
error[E0119]: conflicting implementations of trait `core::cmp::PartialEq<sync::aref::ARef<_>>` for type `sync::aref::ARef<_>`
--> /usr/local/google/home/aliceryhl/devel/linux/rust/kernel/sync/aref.rs:185:1
|
174 | / impl<T, U> PartialEq<ARef<U>> for ARef<T>
175 | | where
176 | | T: AlwaysRefCounted + PartialEq<U>,
177 | | U: AlwaysRefCounted,
| |________________________- first implementation here
...
185 | / impl<T, U> PartialEq<U> for ARef<T>
186 | | where
187 | | T: AlwaysRefCounted + PartialEq<U>,
| |_______________________________________^ conflicting implementation for `sync::aref::ARef<_>`
I can mention this in commit msg if I send another version.
> Reviewed-by: Gary Guo <gary@garyguo.net>
Thanks!
next prev parent reply other threads:[~2026-02-19 14:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 13:52 [PATCH 0/3] rust_binder: check current before closing fds Alice Ryhl
2026-02-19 13:52 ` [PATCH 1/3] rust: sync: implement == operator for ARef Alice Ryhl
2026-02-19 14:27 ` Gary Guo
2026-02-19 14:34 ` Alice Ryhl [this message]
2026-02-19 13:52 ` [PATCH 2/3] rust: task: implement == operator for Task Alice Ryhl
2026-02-19 14:28 ` Gary Guo
2026-02-19 13:52 ` [PATCH 3/3] rust_binder: check current before closing fds Alice Ryhl
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=aZcfbRS6cZuKykkV@google.com \
--to=aliceryhl@google.com \
--cc=a.hindborg@kernel.org \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=cmllamas@google.com \
--cc=dakr@kernel.org \
--cc=gary@garyguo.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tmgross@umich.edu \
/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