Allow the unused_macro_rules lint for now

This makes the transition easier as e.g. allow directives
won't fire the unknown lint warning once it is turned to
warn by default in the future. This is especially
important compared to other lints in the unused group
because the _ prefix trick doesn't exist for macro rules,
so allowing is the only option (either of unused_macro_rules,
or of the entire unused group, but that is not as informative
to readers). Allowing the lint also makes it possible to work
on possible heuristics for disabling the macro in specific
cases.
This commit is contained in:
est31 2022-05-14 03:41:06 +02:00
parent c6499fd998
commit 015e2ae769

View file

@ -790,6 +790,7 @@ declare_lint! {
/// ### Example
///
/// ```rust
/// #[warn(unused_macro_rules)]
/// macro_rules! unused_empty {
/// (hello) => { println!("Hello, world!") }; // This rule is unused
/// () => { println!("empty") }; // This rule is used
@ -814,7 +815,7 @@ declare_lint! {
///
/// [`macro_export` attribute]: https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope
pub UNUSED_MACRO_RULES,
Warn,
Allow,
"detects macro rules that were not used"
}