Re: [PATCH 2/2] rust: add `const_assert!` macro
From: Yury Norov
Date: Thu Feb 12 2026 - 15:16:57 EST
On Mon, Feb 09, 2026 at 12:44:19PM +0100, Miguel Ojeda wrote:
> On Sun, Feb 8, 2026 at 10:07 PM Yury Norov <ynorov@xxxxxxxxxx> wrote:
> >
> > Can you please keep more context? It would be easier to refer to an
> > example if I have it on hand.
>
> The existing docs for `build_assert!` have a couple examples that may help:
>
> https://rust.docs.kernel.org/kernel/macro.build_assert.html
>
> (Those are the kind of examples I would like to have in the module
> level docs, I think they help a lot to quickly see for what each one
> is used for, even if one may not know the exact Rust terminology
> etc.).
>
> > I agree with ""Build-time check" here is a bit confusing", and the
> > following indeed looks like a compiler implementation discussion. So
> > I concluded that the difference between build_assert and const_assert
> > is not visible from programmer's POV. Please correct me if I'm wrong.
>
> Gary has also nicely explained in detail the three Rust ones -- what I
> was suggesting is to take something like that and put it in a single
> explanation in the module docs, with the examples we have (or others).
Yes he did. Thanks to you and Gary for sorting things out. I'll walk
through the #2 of this series shortly, but overall it makes sense and
looks good.
I agree, would be great to wrap explanations up in the docs.