From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: rust: add `Ownable` trait and `Owned` type
Date: Mon, 23 Feb 2026 06:08:49 +1000 [thread overview]
Message-ID: <review-overall-20260220-unique-ref-v15-0-893ed86b06cc@kernel.org> (raw)
In-Reply-To: <20260220-unique-ref-v15-0-893ed86b06cc@kernel.org>
Overall Series Review
Subject: rust: add `Ownable` trait and `Owned` type
Author: Andreas Hindborg <a.hindborg@kernel.org>
Patches: 15
Reviewed: 2026-02-23T06:08:49.862113
---
This is v15 of a Rust kernel infrastructure series by Andreas Hindborg (with contributions from Asahi Lina and Oliver Mangold) that introduces the `Ownable` trait and `Owned<T>` smart pointer type. The series provides a way for C-allocated objects to be uniquely owned by Rust code with custom drop logic, analogous to how `AlwaysRefCounted`/`ARef` works for reference-counted objects. It also adds `OwnableRefCounted` for converting between `Owned` and `ARef`, converts `Page` to use the new infrastructure, implements `ForeignOwnable` for `Owned`, and adds `Page::from_raw()`.
The architecture is sound: splitting `AlwaysRefCounted` into `RefCounted` (the actual refcounting interface) and `AlwaysRefCounted` (a marker trait that permits `&T -> ARef<T>` conversions) is a correct way to prevent soundness issues when a type can be both uniquely owned and ref-counted. The `Owned<T>` type is well-designed as a pinned unique pointer with custom destruction.
I found one likely bug in the `ForeignOwnable` implementation for `Owned<T>` (`FOREIGN_ALIGN` is set incorrectly), a documentation link error, and a few documentation concerns. The mailing list feedback from Alice Ryhl and Miguel Ojeda is also incorporated below where relevant, as several of their comments identify real issues.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-02-22 20:08 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-20 9:51 [PATCH v15 0/9] rust: add `Ownable` trait and `Owned` type Andreas Hindborg
2026-02-20 9:51 ` [PATCH v15 1/9] rust: types: Add Ownable/Owned types Andreas Hindborg
2026-02-20 10:35 ` Alice Ryhl
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 2/9] rust: rename `AlwaysRefCounted` to `RefCounted` Andreas Hindborg
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 3/9] rust: Add missing SAFETY documentation for `ARef` example Andreas Hindborg
2026-02-20 10:49 ` Alice Ryhl
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 4/9] rust: aref: update formatting of use statements Andreas Hindborg
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 5/9] rust: Add `OwnableRefCounted` Andreas Hindborg
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 6/9] rust: page: update formatting of `use` statements Andreas Hindborg
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 7/9] rust: page: convert to `Ownable` Andreas Hindborg
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 8/9] rust: implement `ForeignOwnable` for `Owned` Andreas Hindborg
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-20 9:51 ` [PATCH v15 9/9] rust: page: add `from_raw()` Andreas Hindborg
2026-02-20 10:49 ` Alice Ryhl
2026-02-20 17:33 ` Miguel Ojeda
2026-02-20 17:50 ` Tamir Duberstein
2026-02-22 20:08 ` Claude review: " Claude Code Review Bot
2026-02-22 20:08 ` Claude Code Review Bot [this message]
-- strict thread matches above, loose matches on Subject: below --
2026-02-24 11:17 [PATCH v16 00/10] rust: add `Ownable` trait and `Owned` type Andreas Hindborg
2026-02-27 5:11 ` Claude review: " Claude Code Review 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=review-overall-20260220-unique-ref-v15-0-893ed86b06cc@kernel.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/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