From: sashiko-bot@kernel.org
To: "Andreas Hindborg" <a.hindborg@kernel.org>
Cc: linux-security-module@vger.kernel.org, linux-pci@vger.kernel.org,
linux-usb@vger.kernel.org, linux-serial@vger.kernel.org
Subject: Re: [PATCH v22 4/5] rust: rename `AlwaysRefCounted` to `RefCounted`
Date: Tue, 17 Nov 2026 14:23:01 +0000 [thread overview]
Message-ID: <sashiko-outbox-218956@kernel.org> (raw)
In-Reply-To: <20261116-unique-ref-v22-4-12029383206d@kernel.org>
> From: Oliver Mangold <oliver.mangold@pm.me>
>
> There are types where it may both be reference counted in some cases and
> owned in others. For such types, obtaining an `ARef<T>` from a `&T` may be
> unsound, as it allows creation of an `ARef<T>` from a `&Owned<T>`.
>
> Therefore, we split `AlwaysRefCounted` into `RefCounted` (which `ARef<T>`
> would require) and a marker trait to indicate that the `&T` -> `ARef<T>`
> conversion is sound for the type. A type that implements `Ownable` may
> only implement the marker trait if it allows an `ARef<T>` to exist
> together with an `Owned<T>`.
>
> - Rename `AlwaysRefCounted` to `RefCounted`.
> - Add a new unsafe trait `AlwaysRefCounted`.
> - Implement the new trait `AlwaysRefCounted` for the newly renamed
> `RefCounted` implementations. This leaves functionality of existing
> implementers of `AlwaysRefCounted` intact.
>
> Suggested-by: Alice Ryhl <aliceryhl@google.com>
> Signed-off-by: Oliver Mangold <oliver.mangold@pm.me>
> [ Andreas: Updated commit message, rebased on v7.4-rc2, converted new
> implementers, relaxed the `ForeignOwnable` bound for `ARef<T>`, updated
> safety comments. ]
> Acked-by: Igor Korotin <igor.korotin.linux@gmail.com>
> Acked-by: Danilo Krummrich <dakr@kernel.org>
> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
> Co-developed-by: Andreas Hindborg <a.hindborg@kernel.org>
> Signed-off-by: Andreas Hindborg <a.hindborg@kernel.org>
Sashiko has reviewed this patch and found no issues.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116-unique-ref-v22-0-12029383206d@kernel.org?part=4
next prev parent reply other threads:[~2026-11-17 14:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 14:20 [PATCH v22 0/5] rust: add `Ownable` trait and `Owned` type Andreas Hindborg
2026-11-16 14:20 ` [PATCH v22 1/5] rust: alloc: add `KBox::into_non_null` Andreas Hindborg
2026-11-17 14:22 ` sashiko-bot
2026-11-16 14:20 ` [PATCH v22 2/5] rust: types: Add Ownable/Owned types Andreas Hindborg
2026-11-17 14:22 ` sashiko-bot
2026-11-16 14:21 ` [PATCH v22 3/5] rust: implement `ForeignOwnable` for `Owned` Andreas Hindborg
2026-11-17 14:23 ` sashiko-bot
2026-11-16 14:21 ` [PATCH v22 4/5] rust: rename `AlwaysRefCounted` to `RefCounted` Andreas Hindborg
2026-11-17 14:23 ` sashiko-bot [this message]
2026-11-16 14:21 ` [PATCH v22 5/5] rust: Add `OwnableIntoShared` and `OwnableTryFromShared` Andreas Hindborg
2026-11-17 14:23 ` sashiko-bot
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=sashiko-outbox-218956@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=a.hindborg@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.