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:
Unresolved questions:
Collected issues:
Implementation history:
Unresolved problems
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