Skip to content

Tracking issue: deref patterns #87121

Open

Description

Tracking issue for implementing deref patterns (#[feature(deref_patterns)]).

deref patterns project group repo
lang team initiative issue

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

Status

The current implementation uses a placeholder deref!(<pat>) syntax and is limited to types in the standard library. See the design proposal document for more details.

We limit to types in the standard library using the unstable trait DerefPure (#[feature(deref_pure_trait)]). It is not intended to be stabilized at this stage.

  • Supported std types: Box, Rc, Arc, Vec, String, Cow, Pin, ManuallyDrop, Ref, RefMut.
  • Unstable types that would be eligible : ThinBox, UniqueRc, LazyCell, LazyLock,

There is also a feature gate just for matching string literals on Strings, under #[feature(string_deref_patterns)].

Unresolved Questions

None at this stage

Implementation history

  1. F-deref_patterns S-waiting-on-bors T-compiler T-libs merged-by-bors
    compiler-errors
  2. F-deref_patterns S-waiting-on-author T-compiler T-rustdoc
    WaffleLapkin
  3. F-deref_patterns S-waiting-on-bors T-compiler
    compiler-errors
  4. F-deref_patterns S-waiting-on-bors T-compiler T-libs
    Nadrieril
  5. F-deref_patterns S-waiting-on-bors T-compiler T-libs T-rustdoc
    Nadrieril
  6. S-waiting-on-bors T-compiler
    matthewjasper
  7. F-deref_patterns S-waiting-on-bors T-compiler
    matthewjasper
  8. F-deref_patterns S-waiting-on-author T-libs
    compiler-errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    A-patternsRelating to patterns and pattern matchingC-tracking-issueCategory: A tracking issue for an RFC or an unstable feature.F-deref_patterns`#![feature(deref_patterns)]`S-tracking-design-concernsStatus: There are blocking ❌ design concerns.T-langRelevant to the language team, which will review and decide on the PR/issue.needs-rfcThis change is large or controversial enough that it should have an RFC accepted before doing it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions