[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANiq72mKAt0W_L2L8DX_xpTqxX9CVR_ZJA62C0VM40zF2qwCAg@mail.gmail.com>
Date: Thu, 29 May 2025 15:24:52 +0200
From: Miguel Ojeda <miguel.ojeda.sandonis@...il.com>
To: Tamir Duberstein <tamird@...il.com>
Cc: Miguel Ojeda <ojeda@...nel.org>, Alex Gaynor <alex.gaynor@...il.com>,
Boqun Feng <boqun.feng@...il.com>, Gary Guo <gary@...yguo.net>,
Björn Roy Baron <bjorn3_gh@...tonmail.com>,
Andreas Hindborg <a.hindborg@...nel.org>, Alice Ryhl <aliceryhl@...gle.com>,
Trevor Gross <tmgross@...ch.edu>, Danilo Krummrich <dakr@...nel.org>, Benno Lossin <lossin@...nel.org>,
rust-for-linux@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4] rust: check type of `$ptr` in `container_of!`
On Thu, May 29, 2025 at 3:11 PM Tamir Duberstein <tamird@...il.com> wrote:
>
> Add a compile-time check that `*$ptr` is of the type of `$type->$($f)*`.
> Rename those placeholders for clarity.
I had a variation of v1 already applied locally, let me push and you
can take a look.
> +/// Helper for `container_of!`.
> +#[doc(hidden)]
> +pub fn assert_same_type<T>(_: T, _: T) {}
I meant to have a proper function, possibly "public" (not hidden I
mean). We can do that later, no worries.
Cheers,
Miguel
Powered by blists - more mailing lists