public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: rust: ptr: remove implicit index projection syntax
Date: Thu, 04 Jun 2026 12:43:27 +1000	[thread overview]
Message-ID: <review-patch6-20260602-projection-syntax-rework-v2-6-6989470f5440@garyguo.net> (raw)
In-Reply-To: <20260602-projection-syntax-rework-v2-6-6989470f5440@garyguo.net>

Patch Review

Removes the backward-compatibility shims added in patch 3, now that all callers have been converted:

From `projection.rs`:
```rust
-    // For compatibility
-    (@gen $ptr:ident, [$index:expr]? $($rest:tt)*) => {
-        $crate::ptr::project!(@gen $ptr, [try: $index] $($rest)*)
-    };
-    (@gen $ptr:ident, [$index:expr] $($rest:tt)*) => {
-        $crate::ptr::project!(@gen $ptr, [build: $index] $($rest)*)
-    };
```

And from `dma.rs`, the corresponding old-syntax parse arms in `dma_write!`:
```rust
-    (@parse [$dma:expr] [$($proj:tt)*] [[$index:expr]? $($rest:tt)*]) => {
-        $crate::dma_write!(@parse [$dma] [$($proj)* [$index]?] [$($rest)*])
-    };
-    (@parse [$dma:expr] [$($proj:tt)*] [[$index:expr] $($rest:tt)*]) => {
-        $crate::dma_write!(@parse [$dma] [$($proj)* [$index]] [$($rest)*])
-    };
```

Clean removal. The `dma_read!` macro (not shown in the diff) presumably also had similar old-syntax arms -- it's worth verifying that `dma_read!` is also cleaned up. Looking at the diff for `dma.rs` in this patch, only `dma_write!` is modified. The `dma_read!` macro delegates to `project_pointer!` internally, so it would go through `ptr::project!(@gen ...)` which no longer has the old-syntax arms. If `dma_read!` had its own parsing arms for `[$index]?` and `[$index]`, those should be removed too. However, looking at the overall diffstat, the `dma_read!` macro likely delegates parsing to `project_pointer!` directly (unlike `dma_write!` which has its own `@parse` arms), so this may be correct as-is.

Already has Reviewed-by from Alexandre, Andreas, and Alice. No issues with the removal itself.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-06-04  2:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-02 14:17 [PATCH v2 0/6] Rework index projection syntax Gary Guo
2026-06-02 14:17 ` [PATCH v2 1/6] rust: ptr: rename `ProjectIndex::index` to `build_index` Gary Guo
2026-06-04  2:43   ` Claude review: " Claude Code Review Bot
2026-06-02 14:17 ` [PATCH v2 2/6] rust: ptr: use `match` instead of `unwrap_or_else` for `build_index` Gary Guo
2026-06-04  2:43   ` Claude review: " Claude Code Review Bot
2026-06-02 14:17 ` [PATCH v2 3/6] rust: ptr: add panicking index projection variant Gary Guo
2026-06-04  2:43   ` Claude review: " Claude Code Review Bot
2026-06-02 14:17 ` [PATCH v2 4/6] rust: dma: update to keyworded index projection syntax Gary Guo
2026-06-04  2:43   ` Claude review: " Claude Code Review Bot
2026-06-02 14:17 ` [PATCH v2 5/6] gpu: nova-core: convert to keyworded " Gary Guo
2026-06-04  2:43   ` Claude review: " Claude Code Review Bot
2026-06-02 14:17 ` [PATCH v2 6/6] rust: ptr: remove implicit index " Gary Guo
2026-06-04  2:43   ` Claude Code Review Bot [this message]
2026-06-02 15:03 ` [PATCH v2 0/6] Rework " Danilo Krummrich
2026-06-04  2:43 ` 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-patch6-20260602-projection-syntax-rework-v2-6-6989470f5440@garyguo.net \
    --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