]> git.lizzy.rs Git - rust.git/commitdiff
Allow the unused_macro_rules lint for now
authorest31 <MTest31@outlook.com>
Sat, 14 May 2022 01:41:06 +0000 (03:41 +0200)
committerest31 <MTest31@outlook.com>
Sat, 14 May 2022 10:31:14 +0000 (12:31 +0200)
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.

compiler/rustc_lint_defs/src/builtin.rs

index 7ebb1e85cdb235456a81ec861f4df9706daf2ce7..f942970278399b17e89ba17b641280ba43509aad 100644 (file)
     /// ### Example
     ///
     /// ```rust
+    /// #[warn(unused_macro_rules)]
     /// macro_rules! unused_empty {
     ///     (hello) => { println!("Hello, world!") }; // This rule is unused
     ///     () => { println!("empty") }; // This rule is used
     ///
     /// [`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"
 }