diff options
| author | est31 <MTest31@outlook.com> | 2022-05-14 03:41:06 +0200 |
|---|---|---|
| committer | est31 <MTest31@outlook.com> | 2022-05-14 12:31:14 +0200 |
| commit | 015e2ae76984144a7ece6d8169ff42b6dc7d6870 (patch) | |
| tree | 258db3d0f4c5b1c1cb8ffa541cbc9b92f8ac0602 | |
| parent | c6499fd9987a2b338892f56cea26c39a6fe64d18 (diff) | |
| download | rust-015e2ae76984144a7ece6d8169ff42b6dc7d6870.tar.gz rust-015e2ae76984144a7ece6d8169ff42b6dc7d6870.zip | |
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.
| -rw-r--r-- | compiler/rustc_lint_defs/src/builtin.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs index 7ebb1e85cdb..f9429702783 100644 --- a/compiler/rustc_lint_defs/src/builtin.rs +++ b/compiler/rustc_lint_defs/src/builtin.rs @@ -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" } |
