-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking issue for eRFC 2497, "if- and while-let-chains, take 2" #53667
Copy link
Copy link
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.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-let_chains`#![feature(let_chains)]``#![feature(let_chains)]`S-tracking-ready-to-stabilizeStatus: This is ready to stabilize; it may need a stabilization report and a PRStatus: This is ready to stabilize; it may need a stabilization report and a PRT-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.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-let_chains`#![feature(let_chains)]``#![feature(let_chains)]`S-tracking-ready-to-stabilizeStatus: This is ready to stabilize; it may need a stabilization report and a PRStatus: This is ready to stabilize; it may need a stabilization report and a PRT-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
Note: This feature was stabilized in 1.88.0 but on edition 2024 only. If you are using 1.88.0+ and get an error that the feature is still unstable, please upgrade the edition.
This is a tracking issue for the eRFC "if- and while-let-chains, take 2" (rust-lang/rfcs#2497).
For the tracking issue for the immediate edition changes, see #53668.
Steps:
let_chainsin Rust 1.64 #94927, reverted in Revert let_chains stabilization #100538Unresolved questions:
letas a boolean expression, and possibilities ofissyntax.if lets insidematcharmsCollected issues:
if let true = (false && true) {}#60336scrutinee: boolin if-to-match desugaring in match-expr typeck #60707if-without-else-as-fn-expr.rs#60254match $c { true => $i, _ => $e }is slow #60571if letwhen a failedifblock could be parsed as one #44990Implementation history:
x = ywhereboolis the expected type #59439Let(..)in AST, remove IfLet + WhileLet and parse let chains #60861hir::ExprKind::Let- Take 2 #80357ifexpression before it's "then" block #82308let_chainsworks withif_let_guard#93086let_chainsandif_let_guardfeature flags #93213lets in certain places #97295||in let chain expressions #94754let_elsedoes not interact withlet_chains#94974let_chains] Forbidletinside parentheses #95008||operators are not currently supported in let chain expressions #95314Unresolved problems