Skip to content

Commit c22d4e6

Browse files
committed
Remove unnecessary clap_derive dependency added in 9ee211a
The fixed issue in this commit can be tested without depending on clap/clap_derive. This updates the test case to do so.
1 parent d55c373 commit c22d4e6

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

src/tools/clippy/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ filetime = "0.2"
4040
rustc-workspace-hack = "1.0"
4141

4242
# UI test dependencies
43-
clap = { version = "3.1", features = ["derive"] }
4443
clippy_utils = { path = "clippy_utils" }
4544
derive-new = "0.5"
4645
if_chain = "1.0"

src/tools/clippy/tests/compile-test.rs

-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ const RUN_INTERNAL_TESTS: bool = cfg!(feature = "internal");
2323

2424
/// All crates used in UI tests are listed here
2525
static TEST_DEPENDENCIES: &[&str] = &[
26-
"clap",
2726
"clippy_utils",
2827
"derive_new",
2928
"futures",
@@ -42,8 +41,6 @@ static TEST_DEPENDENCIES: &[&str] = &[
4241
// Test dependencies may need an `extern crate` here to ensure that they show up
4342
// in the depinfo file (otherwise cargo thinks they are unused)
4443
#[allow(unused_extern_crates)]
45-
extern crate clap;
46-
#[allow(unused_extern_crates)]
4744
extern crate clippy_utils;
4845
#[allow(unused_extern_crates)]
4946
extern crate derive_new;

src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ use syn::{
1919
parse_quote, FnArg, ImplItem, ItemImpl, ItemTrait, Lifetime, Pat, PatIdent, PatType, Signature, TraitItem, Type,
2020
};
2121

22+
#[proc_macro_attribute]
23+
pub fn dummy(_args: TokenStream, input: TokenStream) -> TokenStream {
24+
input
25+
}
26+
2227
#[proc_macro_attribute]
2328
pub fn fake_async_trait(_args: TokenStream, input: TokenStream) -> TokenStream {
2429
let mut item = parse_macro_input!(input as ItemTrait);

src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
#![feature(custom_inner_attributes)]
55
#![rustfmt::skip]
66

7-
#[macro_use]
8-
extern crate clap;
9-
107
#[macro_use]
118
extern crate proc_macro_attr;
129

@@ -113,10 +110,10 @@ pub trait Bazz {
113110
}
114111
}
115112

116-
#[derive(clap::Parser)]
117-
#[clap(after_help = "This ia a help message.
113+
#[derive(Clone, Copy)]
114+
#[dummy(string = "first line
118115
119-
You're welcome.
116+
second line
120117
")]
121118
pub struct Args;
122119

src/tools/clippy/tests/ui/empty_line_after_outer_attribute.stderr

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
2-
--> $DIR/empty_line_after_outer_attribute.rs:14:1
2+
--> $DIR/empty_line_after_outer_attribute.rs:11:1
33
|
44
LL | / #[crate_type = "lib"]
55
LL | |
@@ -10,15 +10,15 @@ LL | | fn with_one_newline_and_comment() { assert!(true) }
1010
= note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
1111

1212
error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
13-
--> $DIR/empty_line_after_outer_attribute.rs:26:1
13+
--> $DIR/empty_line_after_outer_attribute.rs:23:1
1414
|
1515
LL | / #[crate_type = "lib"]
1616
LL | |
1717
LL | | fn with_one_newline() { assert!(true) }
1818
| |_
1919

2020
error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
21-
--> $DIR/empty_line_after_outer_attribute.rs:31:1
21+
--> $DIR/empty_line_after_outer_attribute.rs:28:1
2222
|
2323
LL | / #[crate_type = "lib"]
2424
LL | |
@@ -27,23 +27,23 @@ LL | | fn with_two_newlines() { assert!(true) }
2727
| |_
2828

2929
error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
30-
--> $DIR/empty_line_after_outer_attribute.rs:38:1
30+
--> $DIR/empty_line_after_outer_attribute.rs:35:1
3131
|
3232
LL | / #[crate_type = "lib"]
3333
LL | |
3434
LL | | enum Baz {
3535
| |_
3636

3737
error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
38-
--> $DIR/empty_line_after_outer_attribute.rs:46:1
38+
--> $DIR/empty_line_after_outer_attribute.rs:43:1
3939
|
4040
LL | / #[crate_type = "lib"]
4141
LL | |
4242
LL | | struct Foo {
4343
| |_
4444

4545
error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
46-
--> $DIR/empty_line_after_outer_attribute.rs:54:1
46+
--> $DIR/empty_line_after_outer_attribute.rs:51:1
4747
|
4848
LL | / #[crate_type = "lib"]
4949
LL | |

0 commit comments

Comments
 (0)