public inbox for rust-for-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Gary Guo <gary@kernel.org>
To: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Alice Ryhl" <aliceryhl@google.com>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Danilo Krummrich" <dakr@kernel.org>
Cc: Yury Norov <yury.norov@gmail.com>, rust-for-linux@vger.kernel.org
Subject: [PATCH v2 0/4] add `const_assert!` macro and rework documentation
Date: Mon, 16 Mar 2026 15:07:11 +0000	[thread overview]
Message-ID: <20260316150720.1646109-1-gary@kernel.org> (raw)

From: Gary Guo <gary@garyguo.net>

This adds the `const_assert!` macro, rework documentation of all
build-time assertion macros to live under `build_assert` module, and
make that the canonical path to refer to these macros.

There's no functional changes from v1, but the documentation side is
completely overhauled. If you want to test it out, do `make rustdoc` and
browse the rendered documentation.

Link to v1: https://lore.kernel.org/rust-for-linux/20260206171253.2704684-1-gary@kernel.org/

Cc: Yury Norov <yury.norov@gmail.com>

Gary Guo (4):
  rust: move `static_assert` into `build_assert`
  rust: add `const_assert!` macro
  rust: rework `build_assert!` documentation
  rust: make `build_assert` module the home of related macros

 rust/kernel/build_assert.rs          | 194 ++++++++++++++++++++++-----
 rust/kernel/dma.rs                   |   6 +-
 rust/kernel/io/resource.rs           |   2 +-
 rust/kernel/ioctl.rs                 |   2 +-
 rust/kernel/lib.rs                   |   2 -
 rust/kernel/net/phy/reg.rs           |   8 +-
 rust/kernel/num/bounded.rs           |  26 ++--
 rust/kernel/prelude.rs               |  10 +-
 rust/kernel/ptr.rs                   |  12 +-
 rust/kernel/static_assert.rs         |  39 ------
 rust/kernel/sync/atomic/predefine.rs |   3 +-
 rust/kernel/sync/locked_by.rs        |   2 +-
 rust/kernel/sync/refcount.rs         |   8 +-
 rust/kernel/xarray.rs                |   6 +-
 scripts/Makefile.build               |   5 +-
 15 files changed, 207 insertions(+), 118 deletions(-)
 delete mode 100644 rust/kernel/static_assert.rs


base-commit: 5c9e55fecf9365890c64f14761a80f9413a3b1d1
-- 
2.51.2


             reply	other threads:[~2026-03-16 15:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-16 15:07 Gary Guo [this message]
2026-03-16 15:07 ` [PATCH v2 1/4] rust: move `static_assert` into `build_assert` Gary Guo
2026-03-16 15:07 ` [PATCH v2 2/4] rust: add `const_assert!` macro Gary Guo
2026-03-16 17:34   ` Yury Norov
2026-03-16 18:35     ` Miguel Ojeda
2026-03-16 15:07 ` [PATCH v2 3/4] rust: rework `build_assert!` documentation Gary Guo
2026-03-16 17:36   ` Yury Norov
2026-03-16 15:07 ` [PATCH v2 4/4] rust: make `build_assert` module the home of related macros Gary Guo
2026-03-16 17:44   ` Danilo Krummrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260316150720.1646109-1-gary@kernel.org \
    --to=gary@kernel.org \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    --cc=yury.norov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox