mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #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.
This commit is contained in:
@@ -1033,8 +1033,8 @@
|
||||
/// ```rust
|
||||
/// #[warn(unused_macro_rules)]
|
||||
/// macro_rules! unused_empty {
|
||||
/// (hello) => { println!("Hello, world!") }; // This rule is unused
|
||||
/// () => { println!("empty") }; // This rule is used
|
||||
/// (hello) => { println!("Hello, world!") }; // This rule is used
|
||||
/// () => { println!("empty") }; // This rule is unused
|
||||
/// }
|
||||
///
|
||||
/// fn main() {
|
||||
|
||||
Reference in New Issue
Block a user