Skip to content

Tracking issue for pin ergonomics #130494

Open
1 of 1 issue completed
Open
Tracking Issue
1 of 1 issue completed
@traviscross

Description

@traviscross

This is a tracking issue for work on pin ergonomics.

The feature gate for the issue is #![feature(pin_ergonomics)].

Design sketch

The basic pin projection rules that we're working toward are:

  • The type &pin mut T coerces to &mut T if T: Unpin.
  • The type &mut T coerces to &pin mut T if T: Unpin.
  • If T: Drop, then impl !Unpin for T is only allowed if Drop is implemented with fn drop(&pin mut self).
  • Projection of &pin mut T to &pin mut T.U is allowed if T: !Unpin.
  • Projection of &pin mut T to &mut T.U is allowed if U: Unpin.

These rules are factored differently (using coercions and the fact that we haven't stabilized negative impls yet), but have the same effect as the rules in Niko's MinPin proposal.

Beyond pin projection, the basic overall idea of pin ergonomics is that &pin mut T (and &pin const T) should be integrated in the same sense as &mut T, in that reborrowing works, and that the borrow checker will track and ensure that once a &pin mut T is taken (even if no longer live) that we can't later get a &mut T or move T.

About tracking issues

Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

TODO.

Related

TODO.

cc @eholk @rust-lang/lang

Sub-issues

Metadata

Metadata

Labels

B-experimentalBlocker: In-tree experiment; RFC pending, not yet approved or unneeded (requires FCP to stabilize).C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-pin_ergonomics`#![feature(pin_ergonomics)]`T-langRelevant to the language team

Projects

Status

Exploration

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions