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

Implement &pin const self and &pin mut self sugars #135733

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

frank-king
Copy link
Contributor

This PR implements part of #130494.

It introduces the sugars &pin const self and &pin mut self for self: Pin<&Self> and self: Pin<&mut Self>.

@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2025

r? @oli-obk

rustbot has assigned @oli-obk.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 19, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 19, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add tests to ensure that this sugar is not usable in #[cfg]'d out code.

@frank-king frank-king force-pushed the feature/pin-self-receiver branch from 07f960b to f3a88c0 Compare January 20, 2025 03:03
@oli-obk oli-obk added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 20, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Jan 20, 2025

These changes are more likely to conflict with someone's macro_rules macro out there, so we should probably crater it, too. If there is too much breakage we may hold up on adding this syntax and start with a builtin macro expanding to the same ast nodes that you introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants