Re: [PATCH 1/2] rust: list: fix SAFETY comment in List::remove
From: Alice Ryhl
Date: Tue Apr 07 2026 - 04:15:52 EST
On Fri, Apr 03, 2026 at 10:08:15PM +0000, Christian Benton wrote:
> The SAFETY comment for the call to ListLinks::fields in List::remove
> was left as TODO. Fill it in: the call is safe because T::view_links
> returns a reference to the ListLinks field of item, and references are
> always valid and non-dangling.
>
> Signed-off-by: Christian Benton <t1bur0n.kernel.org@xxxxxxxxxxxxx>
Thanks. I agree that `item` being a reference is the only thing needed
for this to be sound, as reference implies that the pointer is not
dangling.
Reviewed-by: Alice Ryhl <aliceryhl@xxxxxxxxxx>