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:
parent
c6499fd998
commit
015e2ae769
1 changed files with 2 additions and 1 deletions
|
@ -790,6 +790,7 @@ declare_lint! {
|
||||||
/// ### Example
|
/// ### Example
|
||||||
///
|
///
|
||||||
/// ```rust
|
/// ```rust
|
||||||
|
/// #[warn(unused_macro_rules)]
|
||||||
/// macro_rules! unused_empty {
|
/// macro_rules! unused_empty {
|
||||||
/// (hello) => { println!("Hello, world!") }; // This rule is unused
|
/// (hello) => { println!("Hello, world!") }; // This rule is unused
|
||||||
/// () => { println!("empty") }; // This rule is used
|
/// () => { 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
|
/// [`macro_export` attribute]: https://doc.rust-lang.org/reference/macros-by-example.html#path-based-scope
|
||||||
pub UNUSED_MACRO_RULES,
|
pub UNUSED_MACRO_RULES,
|
||||||
Warn,
|
Allow,
|
||||||
"detects macro rules that were not used"
|
"detects macro rules that were not used"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue