Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pin!() macro cannot be expressed in Rust 2024 #138718

Open
m-ou-se opened this issue Mar 19, 2025 · 0 comments
Open

pin!() macro cannot be expressed in Rust 2024 #138718

m-ou-se opened this issue Mar 19, 2025 · 0 comments
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.

Comments

@m-ou-se
Copy link
Member

m-ou-se commented Mar 19, 2025

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 by super let.

@m-ou-se m-ou-se added the T-lang Relevant to the language team, which will review and decide on the PR/issue. label Mar 19, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Mar 19, 2025
@fmease fmease added the A-edition-2024 Area: The 2024 edition label Mar 19, 2025
@fmease fmease added C-bug Category: This is a bug. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Mar 19, 2025
@joshtriplett joshtriplett added the I-lang-radar Items that are on lang's radar and will need eventual work or consideration. label Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

4 participants