Implement parsing of pinned borrows by frank-king · Pull Request #135731 · rust-lang/rust

@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

compiler-errors

@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

traviscross

traviscross

@bors bors added the S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

label

Jun 24, 2025

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Jun 25, 2025
…holk,traviscross

Implement parsing of pinned borrows

This PR implements part of rust-lang#130494.

EDIT: It introduces `&pin mut $place` and `&pin const $place` as sugars for `std::pin::pin!($place)` and its shared reference equivalent, except that `$place` will not be moved when borrowing. The borrow check will be in charge of enforcing places cannot be moved or mutably borrowed since being pinned till dropped.

### Implementation steps:
- [x] parse the `&pin mut $place` and `&pin const $place` syntaxes
- [ ] borrowck of `&pin mut|const`
- [ ] support autoref of `&pin mut|const` when needed

This was referenced

Jun 25, 2025

bors added a commit that referenced this pull request

Jun 25, 2025
Rollup of 15 pull requests

Successful merges:

 - #135731 (Implement parsing of pinned borrows)
 - #138780 (Add `#[loop_match]` for improved DFA codegen)
 - #142453 (Windows: make `read_dir` stop iterating after the first error is encountered)
 - #142633 (Error on invalid signatures for interrupt ABIs)
 - #142768 (Avoid a bitcast FFI call in transmuting)
 - #142825 (Port `#[track_caller]` to the new attribute system)
 - #142844 (Enable short-ice for Windows)
 - #142934 (Tweak `-Zmacro-stats` measurement.)
 - #142955 (Couple of test suite fixes for cg_clif)
 - #142977 (rustdoc: Don't mark `#[target_feature]` functions as ⚠)
 - #142980 (Reduce mismatched-lifetime-syntaxes suggestions to MaybeIncorrect)
 - #142982 (Corrected spelling mistake in c_str.rs)
 - #142983 (Taint body on invalid call ABI)
 - #142988 (Update wasm-component-ld to 0.5.14)
 - #142993 (Update cargo)

r? `@ghost`
`@rustbot` modify labels: rollup

rust-timer added a commit that referenced this pull request

Jun 25, 2025
Rollup merge of #135731 - frank-king:feature/pin-borrow, r=eholk,traviscross

Implement parsing of pinned borrows

This PR implements part of #130494.

EDIT: It introduces `&pin mut $place` and `&pin const $place` as sugars for `std::pin::pin!($place)` and its shared reference equivalent, except that `$place` will not be moved when borrowing. The borrow check will be in charge of enforcing places cannot be moved or mutably borrowed since being pinned till dropped.

### Implementation steps:
- [x] parse the `&pin mut $place` and `&pin const $place` syntaxes
- [ ] borrowck of `&pin mut|const`
- [ ] support autoref of `&pin mut|const` when needed

flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request

Jun 26, 2025

tautschnig pushed a commit to model-checking/verify-rust-std that referenced this pull request

Jul 3, 2025

bors added a commit that referenced this pull request

Oct 29, 2025
…raviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of #130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (#135731).~

CC `@traviscross`

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request

Oct 30, 2025
…Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang#135731).~

CC `@traviscross`

Zalathar added a commit to Zalathar/rust that referenced this pull request

Nov 1, 2025
…Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang#135731).~

CC `@traviscross`

Zalathar added a commit to Zalathar/rust that referenced this pull request

Nov 1, 2025
…Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang#135731).~

CC ``@traviscross``

Zalathar added a commit to Zalathar/rust that referenced this pull request

Nov 1, 2025
…Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang#135731).~

CC ```@traviscross```

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Nov 1, 2025
…Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang#135731).~

CC ````@traviscross````

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Nov 1, 2025
…Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang#135731).~

CC `````@traviscross`````

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request

Nov 1, 2025
…Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang#135731).~

CC ``````@traviscross``````

rust-timer added a commit that referenced this pull request

Nov 1, 2025
Rollup merge of #139751 - frank-king:feature/pin-project, r=Nadrieril,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of #130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (#135731).~

CC ``````@traviscross``````

flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request

Nov 14, 2025
…,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang/rust#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang/rust#135731).~

CC ``````@traviscross``````

jieyouxu pushed a commit to jieyouxu/rustfmt that referenced this pull request

Dec 7, 2025
…,traviscross

Implement pin-project in pattern matching for `&pin mut|const T`

This PR implements part of rust-lang/rust#130494. It supports pin-project in pattern matching for `&pin mut|const T`.

~Pin-projection by field access (i.e. `&pin mut|const place.field`) is not fully supported yet since pinned-borrow is not ready (rust-lang/rust#135731).~

CC ``````@traviscross``````

RalfJung

christian-schilling pushed a commit to christian-schilling/rustc_codegen_cranelift that referenced this pull request

Jan 27, 2026

christian-schilling pushed a commit to christian-schilling/rustc_codegen_cranelift that referenced this pull request

Jan 27, 2026

rust-bors bot pushed a commit that referenced this pull request

Feb 27, 2026
…iscross

Implement parsing of pinned borrows

This PR implements part of #130494.

EDIT: It introduces `&pin mut $place` and `&pin const $place` as sugars for `std::pin::pin!($place)` and its shared reference equivalent, except that `$place` will not be moved when borrowing. The borrow check will be in charge of enforcing places cannot be moved or mutably borrowed since being pinned till dropped.

### Implementation steps:
- [x] parse the `&pin mut $place` and `&pin const $place` syntaxes
- [ ] borrowck of `&pin mut|const`
- [ ] support autoref of `&pin mut|const` when needed