From: Gary Guo <gary@garyguo.net>
To: "Alexandre Courbot" <acourbot@nvidia.com>,
"Eliot Courtney" <ecourtney@nvidia.com>,
"Yury Norov" <yury.norov@gmail.com>,
"Miguel Ojeda" <ojeda@kernel.org>,
"Boqun Feng" <boqun@kernel.org>,
"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>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Onur Özkan" <work@onurozkan.dev>
Cc: linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
Gary Guo <gary@garyguo.net>
Subject: [PATCH 0/2] rust: num: add cv! macro to create values from constant expressions (alt)
Date: Fri, 28 Aug 2026 13:03:54 +0100 [thread overview]
Message-ID: <20260828-cv-v1-0-694a695ff17f@garyguo.net> (raw)
This is an alternative to
https://lore.kernel.org/rust-for-linux/20260828-cv-v1-0-48a180dfc4c8@nvidia.com/
and
https://lore.kernel.org/rust-for-linux/20260827-chid-v8-3-bc74c77d0214@nvidia.com
without const generic expressions limitation.
Please see the detailed description in patch 2.
Signed-off-by: Gary Guo <gary@garyguo.net>
---
Gary Guo (2):
rust: build_assert: add utility to require const eval
rust: num: add `cv!` macro to create values from constant expressions
rust/build_error.rs | 7 ++
rust/kernel/build_assert.rs | 9 +-
rust/kernel/device_id.rs | 4 +
rust/kernel/num.rs | 209 +++++++++++++++++++++++++++++++++++++++++++-
rust/kernel/num/bounded.rs | 21 +++++
rust/kernel/ptr.rs | 21 ++++-
rust/macros/const_eval.rs | 24 +++++
rust/macros/lib.rs | 21 +++++
8 files changed, 313 insertions(+), 3 deletions(-)
---
base-commit: e6664f2b33db9b6811eb4cec109f06cb2b4f458d
change-id: 20260828-cv-acaf3400d16c
Best regards,
--
Gary Guo <gary@garyguo.net>
next reply other threads:[~2026-08-28 12:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-28 12:03 Gary Guo [this message]
2026-08-28 12:03 ` [PATCH 1/2] rust: build_assert: add utility to require const eval Gary Guo
2026-08-28 12:03 ` [PATCH 2/2] rust: num: add `cv!` macro to create values from constant expressions Gary Guo
2026-08-28 14:18 ` Gary Guo
2026-08-29 4:05 ` Alexandre Courbot
2026-08-31 7:20 ` Eliot Courtney
2026-08-31 13:09 ` Gary Guo
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=20260828-cv-v1-0-694a695ff17f@garyguo.net \
--to=gary@garyguo.net \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=ecourtney@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lossin@kernel.org \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=work@onurozkan.dev \
--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