Thread (13 messages) 13 messages, 9 authors, 2026-03-27

Re: [PATCH v3 4/4] rust: make `build_assert` module the home of related macros

From: Miguel Ojeda <hidden>
Date: 2026-03-21 13:41:40
Also in: dri-devel, driver-core, lkml, nouveau, rust-for-linux

On Sat, Mar 21, 2026 at 2:32 PM Gary Guo [off-list ref] wrote:
I personally view them all as variants of BUILD_BUG_ON, hence the name is
`build_assert`. I thought about `assert`, but to me that feels like it's going
to host runtime assertions.

I won't be surprised if we're going to have `assert` module in the future to
host families of

    assert!()
    warn_on!()
    unsafe { assume!() }
    ensure!()

etc..
We also have now `unsafe_precondition_assert` in the `safety` module
which is essentially a `debug_assert` at least for now, which could
potentially be moved too.

Most of these (both build time and runtime ones) should be in the
prelude anyway, so they should be easy to reorganize.

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