Skip to content

Tracking Issue for RFC 3535: Constants in Patterns #120362

Closed

Description

@traviscross

This is a tracking issue for the RFC 3535: Constants in Patterns (rust-lang/rfcs#3535).

Summary

When a constant appears as a pattern, this is syntactic sugar for writing a pattern that corresponds to the constant's value by hand. This operation is only allowed when (a) the type of the constant implements PartialEq, and (b) the value of the constant being matched on has "structural equality", which means that PartialEq behaves the same way as that desugared pattern.

This RFC does not allow any new code, compared to what already builds on stable today. Its purpose is to explain the rules for constants in patterns in one coherent document, and to justify why we will start rejecting some code that currently works (see the breaking changes).

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 of the relevant lints

Unresolved questions

Related issues

Activity

  1. added
    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
    T-langRelevant to the language team
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Jan 26, 2024
  2. RustyYato commented on Jan 26, 2024

    @RustyYato
  3. added a commit that references this issue on Feb 8, 2024
  4. added a commit that references this issue on Feb 25, 2024
  5. added a commit that references this issue on Feb 25, 2024
  6. added a commit that references this issue on May 3, 2024
  7. added a commit that references this issue on May 26, 2024
  8. RalfJung commented on Jul 4, 2024

    @RalfJung
    Member

    All the PRs have landed, the lints turned into hard errors, the issue closed... I would say this is done. :)
    #119398 remains open, but it doesn't need to keep this tracking issue open.

    🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCT-langRelevant to the language team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions