What is this lint about
In #57593, it was observed that duplicate macro matcher bindings are allowed in declarations, but unusable in invocations:
macro_rules! foo {
($a:expr, $a:expr) => {}
}
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
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
$ais 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_nameslint as warn-by-defaultduplicate_matcher_binding_nameslint as deny-by-defaultduplicate_matcher_binding_namesa hard error