public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gary Guo" <gary@garyguo.net>
To: "Alice Ryhl" <aliceryhl@google.com>,
	"Danilo Krummrich" <dakr@kernel.org>
Cc: "Benno Lossin" <lossin@kernel.org>, "Gary Guo" <gary@garyguo.net>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun@kernel.org>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Fiona Behrens" <me@kloenk.dev>,
	"Tim Chirananthavat" <theemathas@gmail.com>,
	stable@vger.kernel.org, rust-for-linux@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] rust: pin-init: replace shadowed return token by `unsafe`-to-create token
Date: Wed, 11 Mar 2026 16:11:17 +0000	[thread overview]
Message-ID: <DH0326CEAZM5.QD4X3EEWCVKW@garyguo.net> (raw)
In-Reply-To: <CAH5fLgjdiXMf=xybyf+d+_MWYv6r0SSw+dCNKOLoMmxDdMh9Ag@mail.gmail.com>

On Wed Mar 11, 2026 at 4:04 PM GMT, Alice Ryhl wrote:
> On Wed, Mar 11, 2026 at 2:01 PM Danilo Krummrich <dakr@kernel.org> wrote:
>>
>> On Wed Mar 11, 2026 at 11:50 AM CET, Benno Lossin wrote:
>> > In the face of Type Alias Impl Trait (TAIT) and the next trait solver,
>> > this solution no longer works [1]. The shadowed struct can be named
>> > through type inference. In addition, there is an RFC proposing to add
>> > the feature of path inference to Rust, which would similarly allow [2]
>>
>> NIT: I'm not sure if the sentence is supposed to end here, at least it misses a
>> period.
>>
>> Besides that, is my understanding correct that the changes mentioned above are
>> targeting a subsequent Rust edition?
>
> I don't think it's currently clear when/if the changes mentioned will
> land. But on the topic of editions, it's worth keeping in mind that
> macros don't know the edition they are expanding code into, so the
> macro can't have different logic per edition.

Macro expansion carries information on the def-site edition, so expanded code
that originates from macro itself is parsed using the edition of the macro.

You can test this in action by defining a macro in Rust 2024 using if-let-chain
(which is only available to Rust 2024) and use it from a Rust 2021 crate, and it
will still work.

That said, this specific example is related to syntax, where type inference is
a more global thing so I am unsure how it will interact with cross-edition
macros.

Best,
Gary


>
> Alice


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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-11 10:50 [PATCH] rust: pin-init: replace shadowed return token by `unsafe`-to-create token Benno Lossin
2026-03-11 12:51 ` Gary Guo
2026-03-11 13:01 ` Danilo Krummrich
2026-03-11 16:04   ` Alice Ryhl
2026-03-11 16:11     ` Gary Guo [this message]
2026-03-11 18:14   ` Benno Lossin
2026-03-11 16:02 ` Alice Ryhl
2026-03-12  7:57 ` Miguel Ojeda

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=DH0326CEAZM5.QD4X3EEWCVKW@garyguo.net \
    --to=gary@garyguo.net \
    --cc=a.hindborg@kernel.org \
    --cc=aliceryhl@google.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun@kernel.org \
    --cc=dakr@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lossin@kernel.org \
    --cc=me@kloenk.dev \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=theemathas@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox