Skip to content

Commit 03806ed

Browse files
committed
Auto merge of #4784 - Manishearth:remove-extern, r=Manishearth
Remove `extern crate clippy_lints` from tests This causes rustc's build system to fail because it still tries to load the crate as a plugin: rust-lang/rust#66158 (comment) . I'm not sure _why_ this happens, but for a short term fix we should remove these. In one case it was just a convenient crate to use so i picked a different test. In another it was load-bearing, I had to delete the test. Idk if there's a better way around this. changelog: none
2 parents 426c05a + 4721f44 commit 03806ed

7 files changed

+32
-31
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/lint_without_lint_pass.rs

+15-15
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55
extern crate rustc;
66
use rustc::lint::{LintArray, LintPass};
77

8-
#[macro_use]
9-
extern crate clippy_lints;
10-
11-
declare_clippy_lint! {
12-
pub TEST_LINT,
13-
correctness,
14-
""
8+
declare_tool_lint! {
9+
pub clippy::TEST_LINT,
10+
Warn,
11+
"",
12+
report_in_external_macro: true
1513
}
1614

17-
declare_clippy_lint! {
18-
pub TEST_LINT_REGISTERED,
19-
correctness,
20-
""
15+
declare_tool_lint! {
16+
pub clippy::TEST_LINT_REGISTERED,
17+
Warn,
18+
"",
19+
report_in_external_macro: true
2120
}
2221

23-
declare_clippy_lint! {
24-
pub TEST_LINT_REGISTERED_ONLY_IMPL,
25-
correctness,
26-
""
22+
declare_tool_lint! {
23+
pub clippy::TEST_LINT_REGISTERED_ONLY_IMPL,
24+
Warn,
25+
"",
26+
report_in_external_macro: true
2727
}
2828

2929
pub struct Pass;

tests/ui/lint_without_lint_pass.stderr

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
error: the lint `TEST_LINT` is not added to any `LintPass`
2-
--> $DIR/lint_without_lint_pass.rs:11:1
2+
--> $DIR/lint_without_lint_pass.rs:8:1
33
|
4-
LL | / declare_clippy_lint! {
5-
LL | | pub TEST_LINT,
6-
LL | | correctness,
7-
LL | | ""
4+
LL | / declare_tool_lint! {
5+
LL | | pub clippy::TEST_LINT,
6+
LL | | Warn,
7+
LL | | "",
8+
LL | | report_in_external_macro: true
89
LL | | }
910
| |_^
1011
|

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)