Re: [PATCH] rust: lib: Add necessary unsafes for container_of
From: Philipp Stanner
Date: Mon Nov 17 2025 - 01:37:03 EST
On Fri, 2025-11-14 at 21:21 +0100, Miguel Ojeda wrote:
> On Fri, Nov 14, 2025 at 3:00 PM Philipp Stanner <phasta@xxxxxxxxxx> wrote:
> >
> > Add unsafe blocks to container_of to fix the issue.
>
> The root issue is that we missed unsafe blocks on the list macros
> because imported declarative macros from another crate do not respect
> `unsafe_op_in_unsafe_fn` (or Edition 2024):
>
> https://github.com/rust-lang/rust/issues/112504
>
> I have added it to our list at:
>
> https://github.com/Rust-for-Linux/linux/issues/355
>
> And tagged it with the Rust for Linux label there.
So shall we in the mean time merge a fix as suggested by Alice, IOW a
version 2 of this patch here?
P.