Thread (47 messages) 47 messages, 8 authors, 2025-03-15

Re: [PATCH v7 07/16] rust: add `io::{Io, IoRaw}` base types

From: Miguel Ojeda <hidden>
Date: 2025-02-21 03:59:12
Also in: linux-pci, lkml, rcu, rust-for-linux

Hi Alistair,

On Fri, Feb 21, 2025 at 2:20 AM Alistair Popple [off-list ref] wrote:
Is this a known issue or limitation? Or is this a bug/rough edge that still
needs fixing? Or alternatively am I just doing something wrong? Would appreciate
any insights as figuring out what I'd done wrong here was a bit of a rough
introduction!
Yeah, it is a result of our `build_assert!` machinery:

    https://rust.docs.kernel.org/kernel/macro.build_assert.html

which works by producing a build (link) error rather than the usual
compiler error and thus the bad error message.

`build_assert!` is really the biggest hammer we have to assert
something is true at build time, since it may rely on the optimizer.
For instance, if `static_assert!` is usable in that context, it should
be instead of `build_assert!`.

Ideally we would have a way to get the message propagated somehow,
because it is indeed confusing.

I hope that helps.

Cheers,
Miguel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help