From: Nika Krasnova <nika@nikableh.moe>
To: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: "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>,
"Daniel Almeida" <daniel.almeida@collabora.com>,
"Tamir Duberstein" <tamird@kernel.org>,
"Alexandre Courbot" <acourbot@nvidia.com>,
"Onur Özkan" <work@onurozkan.dev>,
"Viresh Kumar" <viresh.kumar@linaro.org>,
"Yury Norov" <yury.norov@gmail.com>,
"Lorenzo Stoakes" <ljs@kernel.org>,
"Brendan Higgins" <brendan.higgins@linux.dev>,
"David Gow" <david@davidgow.net>,
"Rae Moar" <raemoar63@gmail.com>,
rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
kunit-dev@googlegroups.com, linux-kselftest@vger.kernel.org
Subject: Re: [PATCH 0/2] rust: kernel: add cfg_select! and use it for config-based selection
Date: Wed, 01 Jul 2026 03:39:12 +0200 [thread overview]
Message-ID: <4b9622008ce92cfb5da5d96397ce4c36@purelymail.com> (raw)
In-Reply-To: <CANiq72nVwM_OF4yz1rB4Q-atDgZ9Oywbuhu830jfQe7npt0FeQ@mail.gmail.com>
On 2026-06-29 21:07:34 +0200, Miguel Ojeda wrote:
> The tracking issue says the latest change was in Rust 1.91.0. Did it
> not work there? Were there changes after that?
Checked 1.91.0 directly: core::cfg_select is there behind
#![feature(cfg_select)] and behaves the same as 1.94.1 -- single-brace
expression position included. So 1.91.0 is the cutoff (RUSTC_VERSION >=
109100), nothing changed between 1.91.0 and 1.94.1.
> [...] If I understand you correctly, you are saying that even with
> the conversion here, we wouldn't even need the expression case, no?
That is correct. Everything in this series is item or statement
position;
nothing uses the expression-operand form.
> [...] if we want to go with this one in all versions, then we should
> make sure we only allow that subset that cleanly maps to the future.
Agreed. I'll restrict the fallback to exactly that subset
(item/statement, single braces) by dropping the expression-operand form.
Everyone hits the fallback until the MSRV bump, so a non-portable use
fails uniformly instead of compiling locally and breaking in linux-next.
The accepted subset is a strict subset of core::cfg_select, so the
eventual switch needs no call-site changes. (I'll also have the fallback
emit compile_error! on no-match, to match core.)
> Now, to be honest, the easiest is to just wait a year and then start
> using `core`'s directly... i.e. it is not like we are in a rush to
> start using it anyway...
Fair, I'm fine with dropping it. The counterargument is that the
fallback
is small and self-contained, and the conversion removes a chunk of
easy-to-desync pairs of #[cfg] now rather than in a year. Happy to send
a
v2 if you want it.
--
Nika Krasnova
prev parent reply other threads:[~2026-07-01 1:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-29 3:51 [PATCH 0/2] rust: kernel: add cfg_select! and use it for config-based selection Nika Krasnova
2026-06-29 3:51 ` [PATCH 1/2] rust: kernel: add cfg_select! backport " Nika Krasnova
2026-06-29 3:51 ` [PATCH 2/2] rust: kernel: migrate to cfg_select! " Nika Krasnova
2026-06-29 9:38 ` [PATCH 0/2] rust: kernel: add cfg_select! and use it " Miguel Ojeda
2026-06-29 9:43 ` Miguel Ojeda
2026-06-29 15:34 ` Nika Krasnova
2026-06-29 19:07 ` Miguel Ojeda
2026-07-01 1:39 ` Nika Krasnova [this message]
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=4b9622008ce92cfb5da5d96397ce4c36@purelymail.com \
--to=nika@nikableh.moe \
--cc=a.hindborg@kernel.org \
--cc=acourbot@nvidia.com \
--cc=aliceryhl@google.com \
--cc=bjorn3_gh@protonmail.com \
--cc=boqun@kernel.org \
--cc=brendan.higgins@linux.dev \
--cc=dakr@kernel.org \
--cc=daniel.almeida@collabora.com \
--cc=david@davidgow.net \
--cc=gary@garyguo.net \
--cc=kunit-dev@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=ljs@kernel.org \
--cc=lossin@kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=ojeda@kernel.org \
--cc=raemoar63@gmail.com \
--cc=rust-for-linux@vger.kernel.org \
--cc=tamird@kernel.org \
--cc=tmgross@umich.edu \
--cc=viresh.kumar@linaro.org \
--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