Skip to content

Commit 50843e7

Browse files
eholklqdnikomatsakistomassedovic
authored
2025H2 goal for pin ergonomics (#323)
* Start on a goal around Pin Ergonomics * Apply suggestions from code review Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com> * Update src/2025h2/pin-ergonomics.md * Update src/2025h2/pin-ergonomics.md Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com> * Fix CI --------- Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com> Co-authored-by: Niko Matsakis <niko@alum.mit.edu> Co-authored-by: Tomas Sedovic <tomas@sedovic.cz>
1 parent e07d8b5 commit 50843e7

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

src/2025h2/pin-ergonomics.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Continue Experimentation with Pin Ergonomics
2+
3+
| Metadata | |
4+
|:-----------------|----------------------------------------------------------------------------------|
5+
| Point of contact | @frank-king |
6+
| Task owners | <!-- TASK OWNERS --> |
7+
| Teams | <!-- TEAMS WITH ASKS --> |
8+
| Status | Proposed |
9+
| Tracking issue | |
10+
| Zulip channel | N/A (an existing stream can be re-used or new streams can be created on request) |
11+
12+
## Summary
13+
14+
Continue experimenting with and fleshing out the design and semantics for the pin ergonomics experiment.
15+
16+
## Motivation
17+
18+
Several flagship Rust features, such as `async` and generators, depend on the ability to ensure data will not move in memory.
19+
The way Rust achieves this is through the `Pin` wrapper, but pinning has notoriously poor ergonomics.
20+
Exploring how the ergonomics can be improved by integrating pinning into the language better could help unblock advancements in other Rust features.
21+
22+
### The status quo
23+
24+
Pinning exists but few people like it.
25+
We have an experiment for improving the ergonomics around pinning and some initial PRs have landed, but we would like to build more sustained momentum on it.
26+
27+
### The next 6 months
28+
29+
- introduce `&pin mut|const place` borrowing syntax (parsing #135731 ready to merge, lowering and borrowck not started yet)
30+
- pattern matching of `&pin mut|const T` types (#139751 under review)
31+
- introduce `&pin pat` pattern syntax
32+
- support `&pin mut|const T` -> `&|&mut T` coercion (requires `T: Unpin` of `&pin mut T` -> `&mut T`)
33+
- support auto borrowing of `&pin mut|const place` in method calls with `&pin mut|const self` receivers
34+
35+
### The "shiny future" we are working towards
36+
37+
38+
## Design axioms
39+
40+
## Ownership and team asks
41+
42+
| Task | Owner(s) or team(s) | Notes |
43+
|-----------------------------------|------------------------------------|-------|
44+
| Implementation | @frank-king | |
45+
| Standard reviews | ![Team][] [compiler] | |
46+
| Lang-team champion | ![Team][] [lang] | |
47+
| Design meeting | ![Team][] [lang] | |
48+
| Author call for testing blog post | @frank-king | |
49+
50+
### Definitions
51+
52+
For definitions for terms used above, see the [About > Team Asks](https://rust-lang.github.io/rust-project-goals/about/team_asks.html) page.
53+
54+
* *Discussion and moral support* is the lowest level offering, basically committing the team to nothing but good vibes and general support for this endeavor.
55+
* *Author RFC* and *Implementation* means actually writing the code, document, whatever.
56+
* *Design meeting* means holding a synchronous meeting to review a proposal and provide feedback (no decision expected).
57+
* *RFC decisions* means reviewing an RFC and deciding whether to accept.
58+
* *Org decisions* means reaching a decision on an organizational or policy matter.
59+
* *Secondary review* of an RFC means that the team is "tangentially" involved in the RFC and should be expected to briefly review.
60+
* *Stabilizations* means reviewing a stabilization and report and deciding whether to stabilize.
61+
* *Standard reviews* refers to reviews for PRs against the repository; these PRs are not expected to be unduly large or complicated.
62+
* *Prioritized nominations* refers to prioritized lang-team response to nominated issues, with the expectation that there will be *some* response from the next weekly triage meeting.
63+
* *Dedicated review* means identifying an individual (or group of individuals) who will review the changes, as they're expected to require significant context.
64+
* Other kinds of decisions:
65+
* [Lang team experiments](https://lang-team.rust-lang.org/how_to/experiment.html) are used to add nightly features that do not yet have an RFC. They are limited to trusted contributors and are used to resolve design details such that an RFC can be written.
66+
* Compiler [Major Change Proposal (MCP)](https://forge.rust-lang.org/compiler/mcp.html) is used to propose a 'larger than average' change and get feedback from the compiler team.
67+
* Library [API Change Proposal (ACP)](https://std-dev-guide.rust-lang.org/development/feature-lifecycle.html) describes a change to the standard library.
68+
69+
## Frequently asked questions
70+
71+
### What do I do with this space?

0 commit comments

Comments
 (0)