Skip to content

Commit

Permalink
Auto merge of #4784 - Manishearth:remove-extern, r=Manishearth
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed Nov 7, 2019
2 parents 426c05a + 4721f44 commit 03806ed
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion tests/ui/auxiliary/proc_macro_derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn derive(_: TokenStream) -> TokenStream {
let output = quote! {
// Should not trigger `useless_attribute`
#[allow(dead_code)]
extern crate clippy_lints;
extern crate rustc;
};
output
}
30 changes: 15 additions & 15 deletions tests/ui/lint_without_lint_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@
extern crate rustc;
use rustc::lint::{LintArray, LintPass};

#[macro_use]
extern crate clippy_lints;

declare_clippy_lint! {
pub TEST_LINT,
correctness,
""
declare_tool_lint! {
pub clippy::TEST_LINT,
Warn,
"",
report_in_external_macro: true
}

declare_clippy_lint! {
pub TEST_LINT_REGISTERED,
correctness,
""
declare_tool_lint! {
pub clippy::TEST_LINT_REGISTERED,
Warn,
"",
report_in_external_macro: true
}

declare_clippy_lint! {
pub TEST_LINT_REGISTERED_ONLY_IMPL,
correctness,
""
declare_tool_lint! {
pub clippy::TEST_LINT_REGISTERED_ONLY_IMPL,
Warn,
"",
report_in_external_macro: true
}

pub struct Pass;
Expand Down
11 changes: 6 additions & 5 deletions tests/ui/lint_without_lint_pass.stderr
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
error: the lint `TEST_LINT` is not added to any `LintPass`
--> $DIR/lint_without_lint_pass.rs:11:1
--> $DIR/lint_without_lint_pass.rs:8:1
|
LL | / declare_clippy_lint! {
LL | | pub TEST_LINT,
LL | | correctness,
LL | | ""
LL | / declare_tool_lint! {
LL | | pub clippy::TEST_LINT,
LL | | Warn,
LL | | "",
LL | | report_in_external_macro: true
LL | | }
| |_^
|
Expand Down
1 change: 1 addition & 0 deletions tests/ui/used_underscore_binding.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// aux-build:proc_macro_derive.rs

#![feature(rustc_private)]
#![warn(clippy::all)]
#![allow(clippy::blacklisted_name)]
#![warn(clippy::used_underscore_binding)]
Expand Down
10 changes: 5 additions & 5 deletions tests/ui/used_underscore_binding.stderr
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
error: used binding `_foo` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
--> $DIR/used_underscore_binding.rs:24:5
--> $DIR/used_underscore_binding.rs:25:5
|
LL | _foo + 1
| ^^^^
|
= note: `-D clippy::used-underscore-binding` implied by `-D warnings`

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

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

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

error: used binding `_underscore_field` which is prefixed with an underscore. A leading underscore signals that a binding will not be used.
--> $DIR/used_underscore_binding.rs:43:5
--> $DIR/used_underscore_binding.rs:44:5
|
LL | s._underscore_field += 1;
| ^^^^^^^^^^^^^^^^^^^
Expand Down
5 changes: 2 additions & 3 deletions tests/ui/useless_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

#![warn(clippy::useless_attribute)]
#![warn(unreachable_pub)]
#![feature(rustc_private)]

#[allow(dead_code)]
#[cfg_attr(feature = "cargo-clippy", allow(dead_code))]
#[rustfmt::skip]
#[cfg_attr(feature = "cargo-clippy",
allow(dead_code))]
#[allow(unused_imports)]
#[allow(unused_extern_crates)]
#[macro_use]
extern crate clippy_lints;
extern crate rustc;

#[macro_use]
extern crate proc_macro_derive;
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/useless_attribute.stderr
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
error: useless lint attribute
--> $DIR/useless_attribute.rs:6:1
--> $DIR/useless_attribute.rs:7:1
|
LL | #[allow(dead_code)]
| ^^^^^^^^^^^^^^^^^^^ help: if you just forgot a `!`, use: `#![allow(dead_code)]`
|
= note: `-D clippy::useless-attribute` implied by `-D warnings`

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

0 comments on commit 03806ed

Please sign in to comment.