Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Pattern Guards with Bind-By-Move #15287
Comments
alexcrichton
added
the
B-RFC-approved
label
Jun 30, 2014
zwarich
self-assigned this
Jul 1, 2014
zwarich
removed their assignment
Jan 31, 2015
alexcrichton
added
the
T-compiler
label
Aug 11, 2015
huonw
referenced this issue
Jan 5, 2016
Closed
Allow by-move binding for patterns with guards that don't reference the bindings #14252
This comment has been minimized.
This comment has been minimized.
|
Triage: this has still not been implemented |
This comment has been minimized.
This comment has been minimized.
|
I keep running into this (or rather, the simpler #14252) in places where I now end up with an extra level of indentation: match x {
Foo(v) => if do_a {
// ...
} else if do_b {
// ...
} else if do_c {
// ...
} else {
// ...
}
}when it could be match x {
Foo(v) if do_a => {
// ...
},
Foo(v) if do_b => {
// ...
},
Foo(v) if do_c => {
// ...
},
Foo(v) => {
// ...
}
} |
andjo403
pushed a commit
to andjo403/rust
that referenced
this issue
May 16, 2017
andjo403
pushed a commit
to andjo403/rust
that referenced
this issue
May 17, 2017
andjo403
pushed a commit
to andjo403/rust
that referenced
this issue
May 17, 2017
andjo403
pushed a commit
to andjo403/rust
that referenced
this issue
May 18, 2017
andjo403
pushed a commit
to andjo403/rust
that referenced
this issue
May 18, 2017
andjo403
referenced this issue
May 18, 2017
Closed
implement feature gate bind_by_move_pattern_guards #42088
Mark-Simulacrum
added
C-tracking-issue
and removed
C-enhancement
C-feature-request
labels
Jul 21, 2017
leodasvacas
referenced this issue
Jan 17, 2018
Open
Pattern guard problem replacing FP literal pattern #42663
pnkfelix
added
A-NLL
NLL-fixed-by-NLL
labels
Jul 12, 2018
This comment has been minimized.
This comment has been minimized.
pnkfelix
self-assigned this
Jul 12, 2018
pnkfelix
added
the
E-needstest
label
Jul 12, 2018
This comment has been minimized.
This comment has been minimized.
|
Actually perhaps the right thing for me to do would be to put in the |
pnkfelix
referenced this issue
Sep 7, 2018
Merged
Add feature to enable bind by move pattern guards #54034
bors
added a commit
that referenced
this issue
Sep 18, 2018
pnkfelix
removed
the
E-needstest
label
Sep 19, 2018
This comment has been minimized.
This comment has been minimized.
|
Now that PR #54034 has landed, I'm unassigning myself. (But, if I understand correctly, the issue should stay open until |
pnkfelix
removed their assignment
Sep 19, 2018
This comment has been minimized.
This comment has been minimized.
|
(I guess it would be good to remove the |
pnkfelix
self-assigned this
Sep 24, 2018
pnkfelix
referenced this issue
Sep 29, 2018
Merged
Remove `-Z disable_ast_check_for_mutation_in_guard` #54676
bors
added a commit
that referenced
this issue
Oct 1, 2018
kennytm
added a commit
to kennytm/rust
that referenced
this issue
Oct 1, 2018
This comment has been minimized.
This comment has been minimized.
|
unassigning this from myself; I've done the porting to the NLL test suite, but I have higher priority things on my plate to take care of before I go on leave. (I invite anyone to come and pick up the torch for following through on the remaining steps here!) |
pnkfelix
removed their assignment
Nov 9, 2018
pnkfelix
referenced this issue
Dec 19, 2018
Open
error "cannot bind by-move into a pattern guard" (+ others) is too imprecise and should be removed in favor of MIR borrowck #45600
Centril
added
the
T-lang
label
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
|
since this is implemented and all that remains is 1. making NLL the default everywhere and then 2. stabilizing the feature, I'll let this be handled by T-lang alone now, not T-compiler.
|
pnkfelix
removed
the
T-compiler
label
Dec 21, 2018
Centril
added
the
I-nominated
label
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
|
Nominated for next T-lang meeting to see how we want to proceed, specifically re. @pnkfelix's note re. step 1. |
This comment has been minimized.
This comment has been minimized.
|
In principle I guess stabilizing for Rust 2018 is fine. I'm not sure how much impl complexity that results in -- if nothing else it means more complex branches. I'm a bit wary. |
Centril
removed
the
I-nominated
label
Jan 3, 2019
This comment has been minimized.
This comment has been minimized.
|
I guess in general I would rather wait until NLL has proceeded further down the stability path to take action here. In particular, I'd like to see NLL enabled on all editions first and without any "outstanding questions", essentially (e.g. the 2PB one). |
alexcrichton commentedJun 30, 2014
•
edited by pnkfelix
Tracking issue for "Pattern Guards with Bind-By-Move" (rust-lang/rfcs#107)
Steps: