Skip to content

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

Open
@Centril

Description

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?)

Metadata

Assignees

No one assigned

    Labels

    B-RFC-implementedBlocker: Approved by a merged RFC and implemented.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, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions