Skip to content

Commit fe90b82

Browse files
committed
Remove clippy_lints from useless attribute test
1 parent 7531a08 commit fe90b82

5 files changed

+11
-11
lines changed

tests/ui/auxiliary/proc_macro_derive.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub fn derive(_: TokenStream) -> TokenStream {
1616
let output = quote! {
1717
// Should not trigger `useless_attribute`
1818
#[allow(dead_code)]
19-
extern crate clippy_lints;
19+
extern crate rustc;
2020
};
2121
output
2222
}

tests/ui/used_underscore_binding.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// aux-build:proc_macro_derive.rs
22

3+
#![feature(rustc_private)]
34
#![warn(clippy::all)]
45
#![allow(clippy::blacklisted_name)]
56
#![warn(clippy::used_underscore_binding)]

tests/ui/used_underscore_binding.stderr

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
2-
--> $DIR/used_underscore_binding.rs:24:5
2+
--> $DIR/used_underscore_binding.rs:25:5
33
|
44
LL | _foo + 1
55
| ^^^^
66
|
77
= note: `-D clippy::used-underscore-binding` implied by `-D warnings`
88

99
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
10-
--> $DIR/used_underscore_binding.rs:29:20
10+
--> $DIR/used_underscore_binding.rs:30:20
1111
|
1212
LL | println!("{}", _foo);
1313
| ^^^^
1414

1515
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
16-
--> $DIR/used_underscore_binding.rs:30:16
16+
--> $DIR/used_underscore_binding.rs:31:16
1717
|
1818
LL | assert_eq!(_foo, _foo);
1919
| ^^^^
2020

2121
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
22-
--> $DIR/used_underscore_binding.rs:30:22
22+
--> $DIR/used_underscore_binding.rs:31:22
2323
|
2424
LL | assert_eq!(_foo, _foo);
2525
| ^^^^
2626

2727
error: used binding `_underscore_field` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
28-
--> $DIR/used_underscore_binding.rs:43:5
28+
--> $DIR/used_underscore_binding.rs:44:5
2929
|
3030
LL | s._underscore_field += 1;
3131
| ^^^^^^^^^^^^^^^^^^^

tests/ui/useless_attribute.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22

33
#![warn(clippy::useless_attribute)]
44
#![warn(unreachable_pub)]
5+
#![feature(rustc_private)]
56

67
#[allow(dead_code)]
78
#[cfg_attr(feature = "cargo-clippy", allow(dead_code))]
89
#[rustfmt::skip]
9-
#[cfg_attr(feature = "cargo-clippy",
10-
allow(dead_code))]
1110
#[allow(unused_imports)]
1211
#[allow(unused_extern_crates)]
1312
#[macro_use]
14-
extern crate clippy_lints;
13+
extern crate rustc;
1514

1615
#[macro_use]
1716
extern crate proc_macro_derive;

tests/ui/useless_attribute.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
error: useless lint attribute
2-
--> $DIR/useless_attribute.rs:6:1
2+
--> $DIR/useless_attribute.rs:7: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:7:1
10+
--> $DIR/useless_attribute.rs:8: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)