-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracking issue for RFC 2086: Allow Irrefutable Patterns in if-let and while-let statements #44495
Comments
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 |
I will now start on the implementation of this |
@Nokel81 just checking in -- how's it going? Any questions? |
No, school work came up but I should have a PR ready by Wednesday |
After discussion with @nikomatsakis in Gitter, I'm going to take a stab at this one. |
Okay, I just haven't had time to finish my implementation what with school |
If you've already started on this then I'm happy to leave it @Nokel81. |
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 |
Sure thing. |
Anybody working on this actively? |
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 |
@Nokel81 Sorry, missed that message -- perhaps give some more details of the problem you are encountering? (Alternatively, can you point us at your branch..?) |
(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.) |
Okay thanks. I will try that tomorrow |
@Nokel81 any luck? |
@Nokel81 If you're still having trouble building, I'm interested in taking a crack at this |
I believe that I have solved the building problem and should be able to get a PR tonight. Thanks for the offer though. |
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 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. |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
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 |
The final comment period, with a disposition to merge, as per the review above, is now complete. |
@Nokel81 would you be willing to write up a stabilization PR? |
Sure, however, there was a little discussion on the level. Shall I go with what was proposed in the merge by you (that is |
@Nokel81 Thank you. |
I will see if I can do this tonight |
@Nokel81 any progress? :) |
@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
|
Would any of you be able to review the stabilization PR? |
This stabilises RFC 2086 (rust-lang#44495). Co-Authored-By: Sebastian Malton <[email protected]>
…rns, r=Centril Stabilise irrefutable if-let and while-let patterns This stabilises RFC 2086 (rust-lang#44495). This replaces rust-lang#55639, as we want to stabilise this in time for the beta cut-off. Closes rust-lang#55639. r? @Centril
Stabilized in #57535. Nothing left to do, so closing out. |
This is a tracking issue for the RFC "Allow Irrefutable Patterns in if-let and while-let statements" (rust-lang/rfcs#2086).
Steps:
irrefutable_let_patterns
reference#507)The text was updated successfully, but these errors were encountered: