Closed
Description
This is a tracking issue for the RFC "or-patterns in if / while let expressions" (rust-lang/rfcs#2175).
Steps:
- Implement the RFC (cc @rust-lang/compiler -- can anyone write up mentoring instructions?)Adjust documentation (Stabilize #![feature(if_while_or_patterns)] #57532)Stabilization PR (Stabilize #![feature(if_while_or_patterns)] #57532)
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
zackmdavis commentedon Feb 15, 2018
This seems likely to be a rather straightforward change: currently
parse_arm
callsparse_pats
to parse the|
-separated patterns of amatch
arm, whereasparse_if_let_expr
just callsparse_pat
.I'd like to take this.
zackmdavis commentedon Feb 15, 2018
Arguably we should retitle the issue and RFC to make it clear that the ultimately approved proposal actually includes
let
itself (in addition toif let
andwhile let
).zackmdavis commentedon Feb 15, 2018
Er, this remark was terribly naïve: the change to the parser might be that simple, but then the
IfLet
(&c.) AST nodes have to hold a vector rather than a single pattern, and much of the code that handles them (e.g., HIR lowering) needs to change correspondingly.nikomatsakis commentedon Feb 15, 2018
@zackmdavis
Sounds about right. but it should still be something that can be done purely in HIR lowering, right? I would think so.
zackmdavis commentedon Feb 15, 2018
Visitors, pretty-printing, and resolution are also affected.
nikomatsakis commentedon Feb 15, 2018
Sounds about right. I guess what I meant is "after HIR lowering, I wouldn't expect much other code to care"
|
inif let
andwhile let
(RFC 2175) #48490zackmdavis commentedon Feb 24, 2018
(I was actively working on this today, but would seem to have been pre-empted by #48490.)
Rollup merge of rust-lang#48490 - petrochenkov:orpat, r=eddyb
dtolnay commentedon Mar 31, 2018
Does optional leading vert need to be supported here for consistency with #44101?
@mdinger
32 remaining items