Skip to content

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

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

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

Conversation

frank-king
Copy link
Contributor

@frank-king frank-king commented Apr 13, 2025

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

@rustbot
Copy link
Collaborator

rustbot commented Apr 13, 2025

r? @compiler-errors

rustbot has assigned @compiler-errors.
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 A-attributes Area: Attributes (`#[…]`, `#![…]`) 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 Apr 13, 2025
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Apr 18, 2025

☔ The latest upstream changes (presumably #139996) made this pull request unmergeable. Please resolve the merge conflicts.

@frank-king frank-king force-pushed the feature/pin-project branch from 0ad1543 to e9c97df Compare April 20, 2025 12:53
@rustbot rustbot added the F-autodiff `#![feature(autodiff)]` label Apr 20, 2025
@rust-log-analyzer

This comment has been minimized.

@frank-king frank-king force-pushed the feature/pin-project branch 3 times, most recently from 24e0b14 to aa27a06 Compare April 20, 2025 13:47
@frank-king frank-king changed the title WIP: implement pin-project in pattern matching for &pin mut|const T Implement pin-project in pattern matching for &pin mut|const T Apr 20, 2025
@rust-log-analyzer

This comment has been minimized.

@frank-king frank-king force-pushed the feature/pin-project branch from aa27a06 to c9ca4f8 Compare April 20, 2025 14:22
@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
   Compiling memchr v2.7.4
error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustc_ast_ir`
   --> src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs:168:44
    |
168 |                     TyKind::Ref(..) => Ref(rustc_ast_ir::Pinnedness::Not),
    |                                            ^^^^^^^^^^^^ use of unresolved module or unlinked crate `rustc_ast_ir`
    |
help: there is a crate or module with a similar name
    |
168 -                     TyKind::Ref(..) => Ref(rustc_ast_ir::Pinnedness::Not),
168 +                     TyKind::Ref(..) => Ref(rustc_abi::Pinnedness::Not),
    |

error[E0433]: failed to resolve: use of unresolved module or unlinked crate `rustc_ast_ir`
   --> src/tools/rust-analyzer/crates/hir-ty/src/diagnostics/match_check/pat_analysis.rs:477:52
    |
477 |             TyKind::Ref(..) => ConstructorSet::Ref(rustc_ast_ir::Pinnedness::Not),
    |                                                    ^^^^^^^^^^^^ use of unresolved module or unlinked crate `rustc_ast_ir`
    |
help: there is a crate or module with a similar name
    |
477 -             TyKind::Ref(..) => ConstructorSet::Ref(rustc_ast_ir::Pinnedness::Not),
477 +             TyKind::Ref(..) => ConstructorSet::Ref(rustc_abi::Pinnedness::Not),
    |

[RUSTC-TIMING] serde_repr test:false 0.611
    Checking dot v0.1.4
[RUSTC-TIMING] dot test:false 0.100

@frank-king frank-king marked this pull request as ready for review April 20, 2025 14:39
@rustbot
Copy link
Collaborator

rustbot commented Apr 20, 2025

Some changes occurred to the CTFE machinery

cc @RalfJung, @oli-obk, @lcnr

Some changes occurred in match checking

cc @Nadrieril

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

The Miri subtree was changed

cc @rust-lang/miri

Some changes occurred in compiler/rustc_monomorphize/src/partitioning/autodiff.rs

cc @ZuseZ4

rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead.

cc @rust-lang/rust-analyzer

Some changes occurred in exhaustiveness checking

cc @Nadrieril

Some changes occurred in match lowering

cc @Nadrieril

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred in compiler/rustc_codegen_cranelift

cc @bjorn3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) F-autodiff `#![feature(autodiff)]` 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants