Skip to content

Commit 797526c

Browse files
authored
Rollup merge of rust-lang#153717 - ralpha:unused_macro_rules-lint-correction, r=TaKO8Ki
unused_macro_rules switched used and unused comments Incorrect swapping of "used" and "unused". The 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 } fn main() { unused_empty!(hello); } ``` It is clearly using the `(hello)` case. Yet it is labeled as "unused". This PR fixed that small issue and corrects the mistake.
2 parents 3a2399b + 9fcec02 commit 797526c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

compiler/rustc_lint_defs/src/builtin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,8 +1033,8 @@ declare_lint! {
10331033
/// ```rust
10341034
/// #[warn(unused_macro_rules)]
10351035
/// macro_rules! unused_empty {
1036-
/// (hello) => { println!("Hello, world!") }; // This rule is unused
1037-
/// () => { println!("empty") }; // This rule is used
1036+
/// (hello) => { println!("Hello, world!") }; // This rule is used
1037+
/// () => { println!("empty") }; // This rule is unused
10381038
/// }
10391039
///
10401040
/// fn main() {

0 commit comments

Comments
 (0)