Skip to content

Commit 015e2ae

Browse files
committed
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.
1 parent c6499fd commit 015e2ae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -790,6 +790,7 @@ declare_lint! {
790790
/// ### Example
791791
///
792792
/// ```rust
793+
/// #[warn(unused_macro_rules)]
793794
/// macro_rules! unused_empty {
794795
/// (hello) => { println!("Hello, world!") }; // This rule is unused
795796
/// () => { println!("empty") }; // This rule is used
@@ -814,7 +815,7 @@ declare_lint! {
814815
///
815816
/// [`macro_export` attribute]: https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope
816817
pub UNUSED_MACRO_RULES,
817-
Warn,
818+
Allow,
818819
"detects macro rules that were not used"
819820
}
820821

0 commit comments

Comments
 (0)