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 upTracking issue for RFC 2086: Allow Irrefutable Patterns in if-let and while-let statements #44495
Comments
aturon
added
B-RFC-approved
T-lang
labels
Sep 11, 2017
aturon
referenced this issue
Sep 11, 2017
Merged
RFC: Allow Irrefutable Patterns in if-let and while-let statements #2086
nikomatsakis
added
E-needs-mentor
WG-compiler-middle
T-compiler
labels
Sep 15, 2017
nikomatsakis
added this to the
impl period milestone
Sep 15, 2017
aturon
removed this from the
impl period milestone
Sep 15, 2017
TimNN
added
the
C-tracking-issue
label
Sep 17, 2017
arielb1
self-assigned this
Sep 18, 2017
This comment has been minimized.
This comment has been minimized.
Mentoring InstructionsThis is actually an easy one: The code that emits the error message is the rust/src/librustc_const_eval/check_match.rs Line 317 in 325ba23 It nicely contains branches for You'll also want to declare the new lints you are using, which is done in: rust/src/librustc/lint/builtin.rs Line 19 in 325ba23 Just add another declare_lint! for each new lint.
Feature GatesI should add some version of this to the README.md, but until then: Also, you'll want to feature gate the new feature, so that it can't be used accidentally until its stabilized. For that, add a feature gate to the list of feature gates here: rust/src/libsyntax/feature_gate.rs Line 388 in 325ba23 And link this tracking issue (#44495). You can test the feature in tcx.sess (e.g. tcx.sess.features.borrow().specialization). If it's not present, you should maintain the old behavior.
Don't forget to add tests, both for the new behavior and the old one (the test that the old behavior remains without a feature gate should be in |
arielb1
added
E-mentor
and removed
E-needs-mentor
labels
Sep 19, 2017
This comment has been minimized.
This comment has been minimized.
|
I will now start on the implementation of this |
This comment has been minimized.
This comment has been minimized.
|
@Nokel81 just checking in -- how's it going? Any questions? |
This comment has been minimized.
This comment has been minimized.
|
No, school work came up but I should have a PR ready by Wednesday |
carols10cents
added
the
hacktoberfest
label
Sep 29, 2017
This comment has been minimized.
This comment has been minimized.
|
After discussion with @nikomatsakis in Gitter, I'm going to take a stab at this one. |
This comment has been minimized.
This comment has been minimized.
|
Okay, I just haven't had time to finish my implementation what with school |
This comment has been minimized.
This comment has been minimized.
|
If you've already started on this then I'm happy to leave it @Nokel81. |
This comment has been minimized.
This comment has been minimized.
|
It looks like I should have some time this weekend to finish it so from a time perspective I would prefer it if I could finish |
This comment has been minimized.
This comment has been minimized.
|
Sure thing. |
This comment has been minimized.
This comment has been minimized.
|
Anybody working on this actively? |
This comment has been minimized.
This comment has been minimized.
|
I am and I have what I believe to be a full solution but I have had trouble compiling rustc because I am on windows with VS2017. I even tried following the instructions for not VS2015 but that didn't seem to work |
This comment has been minimized.
This comment has been minimized.
|
@Nokel81 Sorry, missed that message -- perhaps give some more details of the problem you are encountering? (Alternatively, can you point us at your branch..?) |
This comment has been minimized.
This comment has been minimized.
|
(Though honestly the best thing is probably to hop on gitter or maybe #rust on IRC and ask about, since I at least don't know much about getting Rust to build on Windows.) |
This comment has been minimized.
This comment has been minimized.
|
Okay thanks. I will try that tomorrow |
This comment has been minimized.
This comment has been minimized.
|
@Nokel81 any luck? |
This comment has been minimized.
This comment has been minimized.
austinbes
commented
Nov 7, 2017
|
@Nokel81 If you're still having trouble building, I'm interested in taking a crack at this |
This comment has been minimized.
This comment has been minimized.
|
I believe that I have solved the building problem and should be able to get a PR tonight. Thanks for the offer though. |
This comment has been minimized.
This comment has been minimized.
|
@rfcbot merge This was implemented in #49469 which was merged on 2018-06-26 which was 11 weeks ago (more than enough...). I thus propose that we stabilize it with an amendment to make the default lint level Unstable book: Tests: |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Sep 15, 2018
•
|
Team member @Centril has proposed to merge this. The next step is review by the rest of the tagged teams:
No concerns currently listed. Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
rfcbot
added
proposed-final-comment-period
disposition-merge
labels
Sep 15, 2018
This comment has been minimized.
This comment has been minimized.
|
@rfcbot reviewed That said, I still lean towards deny here. I don't think my "WIP reasoning" is a strong argument for warn here, because there obviously aren't any more alternatives that you could be intending to add later. |
rfcbot
added
proposed-final-comment-period
disposition-merge
labels
Sep 27, 2018
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Sep 27, 2018
|
|
rfcbot
added
final-comment-period
and removed
proposed-final-comment-period
labels
Sep 27, 2018
This comment has been minimized.
This comment has been minimized.
|
I would lean towards deny for a single if let but warn for multiple if lets because of the set up process that multiple if lets can allow for |
This comment has been minimized.
This comment has been minimized.
rfcbot
commented
Oct 7, 2018
|
The final comment period, with a disposition to merge, as per the review above, is now complete. |
rfcbot
added
finished-final-comment-period
and removed
final-comment-period
labels
Oct 7, 2018
This comment has been minimized.
This comment has been minimized.
|
@Nokel81 would you be willing to write up a stabilization PR? |
This comment has been minimized.
This comment has been minimized.
|
Sure, however, there was a little discussion on the level. Shall I go with what was proposed in the merge by you (that is |
This comment has been minimized.
This comment has been minimized.
|
@Nokel81 Thank you. |
This comment has been minimized.
This comment has been minimized.
|
I will see if I can do this tonight |
This comment has been minimized.
This comment has been minimized.
|
@Nokel81 any progress? :) |
This comment has been minimized.
This comment has been minimized.
|
@Centril I have made the code change but I wanted to make sure that I could build it before making the PR. My build fails (even without the code change so I think it is something to do with my environment) with the following error
|
This comment has been minimized.
This comment has been minimized.
|
Would any of you be able to review the stabilization PR? |
varkor
added a commit
to varkor/rust
that referenced
this issue
Jan 12, 2019
varkor
referenced this issue
Jan 12, 2019
Merged
Stabilise irrefutable if-let and while-let patterns #57535
bors
added a commit
that referenced
this issue
Jan 12, 2019
Centril
added a commit
to Centril/rust
that referenced
this issue
Jan 12, 2019
This comment has been minimized.
This comment has been minimized.
|
Stabilized in #57535. Nothing left to do, so closing out. |
aturon commentedSep 11, 2017
•
edited by Centril
This is a tracking issue for the RFC "Allow Irrefutable Patterns in if-let and while-let statements" (rust-lang/rfcs#2086).
Steps: