pin!()
macro cannot be expressed in Rust 2024
#138718
Labels
A-edition-2024
Area: The 2024 edition
C-bug
Category: This is a bug.
I-lang-radar
Items that are on lang's radar and will need eventual work or consideration.
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
See #138596
It looks like Rust 2024 regressed in expressivity. The
pin!()
macro cannot be expressed in Rust 2024 code in a way that temporary lifetimes work the same as in its original Rust 2021 definition.As a temporary workaround for
pin!()
itself, #138717 adds#[rustc_macro_edition_2021]
.Both #138622 (comment) and #138717 mention
super let
as the proper solution.One could argue that
pin!()
cannot be expressed in any Rust edition, because it relies on an unstable public (hidden) field and#[allow_internal_unstable]
. This problem is also solved bysuper let
.The text was updated successfully, but these errors were encountered: