Re: [PATCH] rust: pin-init: replace shadowed return token by `unsafe`-to-create token

From: Gary Guo

Date: Wed Mar 11 2026 - 12:16:45 EST


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@xxxxxxxxxx> 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