From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: rust: auxiliary: add registration_data_with() for ForLt types Date: Thu, 04 Jun 2026 12:08:39 +1000 Message-ID: In-Reply-To: <20260603011020.2073650-4-dakr@kernel.org> References: <20260603011020.2073650-1-dakr@kernel.org> <20260603011020.2073650-4-dakr@kernel.org> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Patch Review The private helper extraction is clean: ```rust unsafe fn registration_data_pinned(&self) -> Result>> ``` The `registration_data_with` closure-based API correctly uses an HRTB closu= re: ```rust pub fn registration_data_with( &self, f: impl for<'a> FnOnce(Pin<&'a F::Of<'a>>) -> R, ) -> Result ``` The soundness argument is correct: the `for<'a>` quantification prevents th= e closure from capturing external references with a concrete short lifetime= and smuggling them into the invariant type. The round-trip (`'bound` =E2= =86=92 `'static` =E2=86=92 `'a`) is safe because `'a` is universally quanti= fied. Relaxing `Registration`'s bound from `CovariantForLt` to `ForLt` is the rig= ht move =E2=80=94 it lets invariant types be registered while `registration= _data()` (requiring `CovariantForLt`) remains available as a convenience. **Minor observation:** The three separate `unsafe` blocks in `registration_= data_with` could arguably share a single safety comment since they're all j= ustified by the same HRTB argument. The current form with individual commen= ts is verbose but not wrong. --- Generated by Claude Code Patch Reviewer