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: pci: return DevresLt from Bar::into_devres() Date: Thu, 04 Jun 2026 12:08:40 +1000 Message-ID: In-Reply-To: <20260603011020.2073650-7-dakr@kernel.org> References: <20260603011020.2073650-1-dakr@kernel.org> <20260603011020.2073650-7-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 manual `ForLt` and `CovariantForLt` impls on `Bar<'static, SIZE>`: ```rust impl ForLt for Bar<'static, SIZE> { type Of<'a> =3D Bar<'a, SIZE>; } // SAFETY: `Bar<'a, SIZE>` is covariant over `'a`; it holds `&'a Device`, // which is covariant. unsafe impl CovariantForLt for Bar<'static, SIZE> {} ``` This bypasses the macro's compile-time covariance proof, relying instead on= a manual safety argument. For `Bar`, which holds only `&'a Device` = (covariant) and `PhantomData`/raw pointers/scalars, the covariance claim is= clearly correct. The `into_devres()` simplification is a nice improvement =E2=80=94 the expl= icit `transmute` is replaced by `DevresLt::new()` which handles it internal= ly: ```rust pub fn into_devres(self) -> Result> { let pdev =3D self.pdev; unsafe { DevresLt::new(pdev.as_ref(), self) } } ``` **Minor note on the diff context:** ```rust types::{ CovariantForLt, ForLt, // }, // ``` The double `//` trailing comments look like formatting artifacts from the m= acro expansion or tooling. Cosmetic only. --- Generated by Claude Code Patch Reviewer