Skip to content

Tracking issue for RFC 2086: Allow Irrefutable Patterns in if-let and while-let statements #44495

Closed

Description

@aturon

This is a tracking issue for the RFC "Allow Irrefutable Patterns in if-let and while-let statements" (rust-lang/rfcs#2086).

Steps:

Activity

  1. added
    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
    T-langRelevant to the language team
    on Sep 11, 2017
  2. added this to the milestone on Sep 15, 2017
  3. removed this from the milestone on Sep 15, 2017
  4. added
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    on Sep 17, 2017
  5. self-assigned this
    on Sep 18, 2017
  6. arielb1 commented on Sep 19, 2017

    @arielb1
    Contributor

    Mentoring Instructions

    This is actually an easy one:

    The code that emits the error message is the check_arms function here:

    fn check_arms<'a, 'tcx>(cx: &mut MatchCheckCtxt<'a, 'tcx>,

    It nicely contains branches for if let and while let, so we just need to adapt them to emit lints instead of errors. We emit lints using the lint_node function - you can see an example calls of it below in the function. Remember to add a feature gate.

    You'll also want to declare the new lints you are using, which is done in:

    declare_lint! {

    Just add another declare_lint! for each new lint.

    Feature Gates

    I 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:


    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 src/test/compile-fail/feature-gate-YOUR-FEATURE.rs).

  7. added
    E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
    and removed on Sep 19, 2017
  8. Nokel81 commented on Sep 19, 2017

    @Nokel81
    Contributor

    I will now start on the implementation of this

  9. nikomatsakis commented on Sep 25, 2017

    @nikomatsakis
    Contributor

    @Nokel81 just checking in -- how's it going? Any questions?

  10. Nokel81 commented on Sep 25, 2017

    @Nokel81
    Contributor

    No, school work came up but I should have a PR ready by Wednesday

  11. 35 remaining items

  12. rfcbot commented on Oct 7, 2018

    @rfcbot

    The final comment period, with a disposition to merge, as per the review above, is now complete.

  13. added and removed
    final-comment-periodIn the final comment period and will be merged soon unless new substantive objections are raised.
    on Oct 7, 2018
  14. Centril commented on Oct 7, 2018

    @Centril
    Contributor

    @Nokel81 would you be willing to write up a stabilization PR?

  15. Nokel81 commented on Oct 7, 2018

    @Nokel81
    Contributor

    Sure, however, there was a little discussion on the level. Shall I go with what was proposed in the merge by you (that is Warn instead of Deny)

  16. Centril commented on Oct 7, 2018

    @Centril
    Contributor

    @Nokel81 Thank you.
    What was proposed in the FCP merge proposal; that is: Warn.

  17. Nokel81 commented on Oct 12, 2018

    @Nokel81
    Contributor

    I will see if I can do this tonight

  18. Centril commented on Oct 27, 2018

    @Centril
    Contributor

    @Nokel81 any progress? :)

  19. Nokel81 commented on Oct 27, 2018

    @Nokel81
    Contributor

    @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

    error: failed to run custom build command for `alloc_jemalloc v0.0.0 (/home/sebastian/rust/src/liballoc_jemalloc)`                                      
    
  20. Nokel81 commented on Nov 3, 2018

    @Nokel81
    Contributor

    #55639

    Would any of you be able to review the stabilization PR?

  21. added a commit that references this issue on Jan 12, 2019
  22. Centril commented on Jan 12, 2019

    @Centril
    Contributor

    Stabilized in #57535.
    Reference issue: rust-lang/reference#507.

    Nothing left to do, so closing out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCE-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamdisposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions