81f5969704
This fixes an incorrect suggestion from the `useless_attribute` lint when using `cfg_attr`. Additionally, it will not show a suggestion anymore, if the attribute begins on a previous line, because it is much harder to construct the span of multi-line `cfg_attr` attributes as they don't appear in the AST. To fix it completely, one would have to parse upwards into the file, and find the beginning of the `cfg_attr` attribute.
17 lines
698 B
Plaintext
17 lines
698 B
Plaintext
error: useless lint attribute
|
|
--> $DIR/useless_attribute.rs:5:1
|
|
|
|
|
5 | #[allow(dead_code, unused_extern_crates)]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(dead_code, unused_extern_crates)]`
|
|
|
|
|
= note: `-D useless-attribute` implied by `-D warnings`
|
|
|
|
error: useless lint attribute
|
|
--> $DIR/useless_attribute.rs:6:1
|
|
|
|
|
6 | #[cfg_attr(feature = "cargo-clippy", allow(dead_code, unused_extern_crates))]
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![cfg_attr(feature = "cargo-clippy", allow(dead_code, unused_extern_crates))`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|