Skip to content

Tracking issue for RFC 2294, "if let guard" #51114

Closed

Description

@Centril

View all comments

This is a tracking issue for the RFC "if let guard" (rust-lang/rfcs#2294).

Steps:

Unresolved questions:

  • Work out the exact semantics / borrowck (cc @nikomatsakis, @pnkfelix)
    • Add unit tests analogous to the existing if guard ones that test if let guard instead
    • Ensure that the documentation of these details, if any, give equal footing to if and if let guards.
    • (If there is no documentation of if guards behavior w.r.t. move semantics, I do not think that should hold up stabilizing this feature. We can just file an issue that those things need to be documented.)
  • pnkfelix: The fact that both this feature and let else were implemented but had problems discovered relatively late with their handling of certain details w.r.t. locals and temporary r-values is a hint that we may need to revisit our approach to testing features like this more broadly, in terms of how we advise implementors of such features on how to probe for such cases (and maybe also in the form of some kind of language-oriented test-generation tooling?)

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 May 27, 2018
  2. imjacobclark commented on Jan 9, 2019

    @imjacobclark
    Contributor

    👋 After a conversation about this change with @varkor I'm starting to take a look at this with a view to implementing it!

  3. alexreg commented on May 6, 2019

    @alexreg
    Contributor

    @imjacobclark Hey. Any progress over the past few months? :-)

  4. ebkalderon commented on Jun 5, 2019

    @ebkalderon
    Contributor

    Just ran into a case where this ability would be useful. I look forward to this feature landing someday!

  5. Vincent-liuwingsang commented on Jun 16, 2019

    @Vincent-liuwingsang

    +1 This would be a nice feature to have!

  6. added a commit that references this issue on Jun 23, 2019
  7. added a commit that references this issue on Jun 23, 2019
  8. added a commit that references this issue on Jun 24, 2019
  9. Silhalnor commented on Aug 1, 2019

    @Silhalnor

    Am currently learning Rust and thought it was unintuitive that I couldn't write this syntax. (Thought I must be mis-writing it somehow.) Lo, here it is in progress! Woo~

  10. added
    E-help-wantedCall for participation: Help is requested to fix this issue.
    on Sep 28, 2019
  11. Boscop commented on Mar 17, 2020

    @Boscop

    Any update on this? :)

  12. 100 remaining items

  13. added a commit that references this issue on Aug 31, 2026
  14. added a commit that references this issue on Sep 7, 2026
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-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-if_let_guard`#![feature(if_let_guard)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.T-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