Skip to content

Commit eeeadf3

Browse files
committed
Make useless_attribute suggestion MaybeIncorrect
1 parent f416779 commit eeeadf3

File tree

4 files changed

+3
-53
lines changed

4 files changed

+3
-53
lines changed

clippy_lints/src/attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Attributes {
277277
line_span,
278278
"if you just forgot a `!`, use",
279279
sugg,
280-
Applicability::MachineApplicable,
280+
Applicability::MaybeIncorrect,
281281
);
282282
},
283283
);

tests/ui/useless_attribute.fixed

Lines changed: 0 additions & 49 deletions
This file was deleted.

tests/ui/useless_attribute.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// run-rustfix
21
// aux-build:proc_macro_derive.rs
32

43
#![warn(clippy::useless_attribute)]

tests/ui/useless_attribute.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: useless lint attribute
2-
--> $DIR/useless_attribute.rs:7:1
2+
--> $DIR/useless_attribute.rs:6:1
33
|
44
LL | #[allow(dead_code)]
55
| ^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(dead_code)]`
66
|
77
= note: `-D clippy::useless-attribute` implied by `-D warnings`
88

99
error: useless lint attribute
10-
--> $DIR/useless_attribute.rs:8:1
10+
--> $DIR/useless_attribute.rs:7:1
1111
|
1212
LL | #[cfg_attr(feature = "cargo-clippy", allow(dead_code))]
1313
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![cfg_attr(feature = "cargo-clippy", allow(dead_code)`

0 commit comments

Comments
 (0)