public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: "Benno Lossin" <lossin@kernel.org>
To: "Alice Ryhl" <aliceryhl@google.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>
Cc: "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"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,
	"Daniel Almeida" <daniel.almeida@collabora.com>
Subject: Re: [PATCH v2] rust: sync: implement Unpin for ARef
Date: Thu, 18 Dec 2025 11:24:47 +0100	[thread overview]
Message-ID: <DF19PO1J860C.1A15C38JSTK1J@kernel.org> (raw)
In-Reply-To: <20251218-unpin-for-aref-v2-1-30d77129cbc6@google.com>

On Thu Dec 18, 2025 at 9:25 AM CET, Alice Ryhl wrote:
> The default implementation of Unpin for ARef<T> is conditional on T
> being Unpin due to its PhantomData<T> field. However, this is overly
> strict as pointers to T are legal to move even if T itself cannot move.
>
> Since commit 66f1ea83d9f8 ("rust: lock: Add a Pin<&mut T> accessor")
> this causes build failures when combined with a Mutex that contains an
> field ARef<T>, because almost any type that ARef is used with is !Unpin.
>
> Reviewed-by: Daniel Almeida <daniel.almeida@collabora.com>
> Signed-off-by: Alice Ryhl <aliceryhl@google.com>

Reviewed-by: Benno Lossin <lossin@kernel.org>

Cheers,
Benno

> ---
> Changes in v2:
> - Add T: AlwaysRefCounted bound.
> - Link to v1: https://lore.kernel.org/r/20251217-unpin-for-aref-v1-1-84711b747d02@google.com
> ---
>  rust/kernel/sync/aref.rs | 3 +++
>  1 file changed, 3 insertions(+)

  reply	other threads:[~2025-12-18 10:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18  8:25 [PATCH v2] rust: sync: implement Unpin for ARef Alice Ryhl
2025-12-18 10:24 ` Benno Lossin [this message]
2025-12-18 10:26 ` Miguel Ojeda
2025-12-18 13:23   ` Boqun Feng
2025-12-18 11:07 ` Alexandre Courbot

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=DF19PO1J860C.1A15C38JSTK1J@kernel.org \
    --to=lossin@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=daniel.almeida@collabora.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.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