-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Open
Labels
B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-if_let_guard`#![feature(if_let_guard)]``#![feature(if_let_guard)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.Status: The implementation is incomplete.T-langRelevant to the language teamRelevant to the language team
Description
This is a tracking issue for the RFC "if let guard" (rust-lang/rfcs#2294).
Steps:
- Implement the RFC (implemented in Implement if-let match guards #79051)
- Adjust documentation
- Stabilization PR
Unresolved questions:
- Work out the exact semantics / borrowck (cc @nikomatsakis, @pnkfelix)
- Add unit tests analogous to the existing
if
guard ones that testif let
guard instead - Ensure that the documentation of these details, if any, give equal footing to
if
andif 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.)
- Add unit tests analogous to the existing
- 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?)
luojia65, Munksgaard, Silhalnor, skurmedel, NyxCode and 104 moreScripter17 and schneiderfelipesudipghimire533, kkmp-dk, yujingaya, abhikjain360, Dushistov and 11 more
Metadata
Metadata
Assignees
Labels
B-RFC-implementedBlocker: Approved by a merged RFC and implemented but not stabilized.Blocker: Approved by a merged RFC and implemented but not stabilized.B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCF-if_let_guard`#![feature(if_let_guard)]``#![feature(if_let_guard)]`S-tracking-impl-incompleteStatus: The implementation is incomplete.Status: The implementation is incomplete.T-langRelevant to the language teamRelevant to the language team