-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 duplicate_matcher_binding_names
compatibility lint
#57742
Comments
cc @Centril |
Note: The future compatibility lint has hit stable by now... |
@mark-i-m I think we have given it enough time; would you like to prepare a PR that turns it into a hard error directly and let's crater + merge that one? |
@Centril Sure, but should we not make it deny-by-default first? I don't there is a particular hurry on this, right? |
…Centril warn -> deny duplicate match bindings This is the next step of rust-lang#57742 r? @Centril - [x] Decide whether to go to deny-by-default or hard error. - My preference is to make this deny-by-default, rather than going straight to a hard error. The CI should fail because I haven't updated the ui test yet. I'll update it when we decide which to do. - [x] Update [test](https://github.com/mark-i-m/rust/blob/c25d6b83441e0c060ee0273193ef27b29e1318cd/src/test/ui/macros/macro-multiple-matcher-bindings.rs) - [ ] ~Crater run~ see rust-lang#59394 (comment)
Note to self: The next step is to merge this branch: master...mark-i-m:dup-matcher-bindings-3 |
…Centril Make duplicate matcher bindings a hard error r? @Centril Closes rust-lang#57742
…Centril Make duplicate matcher bindings a hard error r? @Centril Closes rust-lang#57742
…Centril Make duplicate matcher bindings a hard error r? @Centril Closes rust-lang#57742
…Centril Make duplicate matcher bindings a hard error r? @Centril Closes rust-lang#57742
What is this lint about
In #57593, it was observed that duplicate macro matcher bindings are allowed in declarations, but unusable in invocations:
This is macro compiles fine on its own, but any attempt to use it will result in an error because
$a
is bound twice. This is likely an oversight in the original implementation, but it really feels like a bug, so we want to make this a hard error.This compatibility lint warns on such a declaration. The end goal is to make this a hard error in a few releases.
How to fix this warning/error
Change the binding names to be different.
Current status
duplicate_matcher_binding_names
lint as warn-by-defaultduplicate_matcher_binding_names
lint as deny-by-defaultduplicate_matcher_binding_names
a hard errorThe text was updated successfully, but these errors were encountered: