All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexandre Courbot" <acourbot@nvidia.com>
To: "Miguel Ojeda" <miguel.ojeda.sandonis@gmail.com>,
	"Alexandre Courbot" <acourbot@nvidia.com>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"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>,
	"Nathan Chancellor" <nathan@kernel.org>,
	"Nicolas Schier" <nicolas.schier@linux.dev>,
	linux-kernel@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-kbuild@vger.kernel.org
Subject: Re: [PATCH RESEND] rust: enable slice_flatten feature and abstract it through an extension trait
Date: Sun, 02 Nov 2025 23:28:45 +0900	[thread overview]
Message-ID: <DDYA3ECFG4D3.1H28762AJJ0Q4@nvidia.com> (raw)
In-Reply-To: <CANiq72nakhVrfK=pyz8VBo95NJHpoeDXRkqUBc4GXSdroYuAQQ@mail.gmail.com>

On Sun Nov 2, 2025 at 9:00 PM JST, Miguel Ojeda wrote:
> On Sun, Nov 2, 2025 at 3:25 AM Alexandre Courbot <acourbot@nvidia.com> wrote:
>>
>> Also not all of these seem to be tied to a feature;
>> `RUSTC_HAS_FILE_AS_C_STR` appears to refer to the
>> `Location::file_as_c_str` method, which is behind the `file_with_nul`
>> feature.
>
> So what happens there is that there are 3 states: "not implemented",
> "unstable" and "unstable but changed". That is, one transition is when
> the stdlib added it and the other when it changed.
>
> Now, normally there are only 2: "not implemented" and "unstable", and
> thus using the feature name makes sense there, because we use the
> Kconfig symbol to enable the feature conditionally, not individual
> methods (and a feature may contain different methods or even language
> features etc.).
>
> There is also the "stable" state of course -- the features don't get
> removed internally when stabilized, and in fact there is a lint that
> tells you about it (using that information), but we allow it, so it
> all works without extra complexity.
>
> In this case, we have 2 states but the other ones: "unstable" and
> "unstable but changed", because `slice_flatten` exists for way longer
> than our MSRV. And for this transition, for the other feature, we used
> the renamed method name, which makes sense since that is what got
> renamed, e.g. it could happen that a feature has 10 methods, and 2 get
> renamed in version X.
>
> So I think what you have in your patch actually makes more sense,
> since you are in the rename transition, not the feature addition one
> (i.e. we unconditionally enable `slice_flatten`).
>
> I guess we could come up with a different naming scheme to distinguish
> both cases or similar. For instance, we could add `FEATURE_` to the
> cases of the first transition. Anyway, it is not a big deal since we
> don't expect to have a ton of these -- quite the opposite, hopefully
> we can get rid them soon. And I wouldn't invert the logic of those
> equations, I think that gets even more confusing.
>
> So apologies for the noise there :) At least I hope it clarifies a bit...

It does - thanks for taking the time to explain!

I'll leave the config option name as it currently then.

  reply	other threads:[~2025-11-02 14:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-01 13:31 [PATCH RESEND] rust: enable slice_flatten feature and abstract it through an extension trait Alexandre Courbot
2025-11-01 15:36 ` Miguel Ojeda
2025-11-02  2:25   ` Alexandre Courbot
2025-11-02 12:00     ` Miguel Ojeda
2025-11-02 14:28       ` Alexandre Courbot [this message]
2025-11-01 15:52 ` Danilo Krummrich
2025-11-03 10:22 ` Alice Ryhl
2025-11-03 15:06   ` Alexandre Courbot
2025-11-04  8:37     ` Alice Ryhl
2025-11-04 10:57       ` Alexandre Courbot

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=DDYA3ECFG4D3.1H28762AJJ0Q4@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=miguel.ojeda.sandonis@gmail.com \
    --cc=nathan@kernel.org \
    --cc=nicolas.schier@linux.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=tmgross@umich.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.