about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilipp Krones <hello@philkrones.com>2022-06-04 14:04:35 +0200
committerPhilipp Krones <hello@philkrones.com>2022-06-04 14:04:35 +0200
commitc22d4e6b3462cdb2b5c90ee57c487a252a0da776 (patch)
tree49528338d5b316798ba6fb91c490e73bb9ca954d
parentd55c373ddd1ec4f9bee281801f85283ac44140a7 (diff)
downloadrust-c22d4e6b3462cdb2b5c90ee57c487a252a0da776.tar.gz
rust-c22d4e6b3462cdb2b5c90ee57c487a252a0da776.zip
Remove unnecessary clap_derive dependency added in 9ee211af
The fixed issue in this commit can be tested without depending on
clap/clap_derive. This updates the test case to do so.
-rw-r--r--src/tools/clippy/Cargo.toml1
-rw-r--r--src/tools/clippy/tests/compile-test.rs3
-rw-r--r--src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs5
-rw-r--r--src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs9
-rw-r--r--src/tools/clippy/tests/ui/empty_line_after_outer_attribute.stderr12
5 files changed, 14 insertions, 16 deletions
diff --git a/src/tools/clippy/Cargo.toml b/src/tools/clippy/Cargo.toml
index d23d681df00..3c8b758d53d 100644
--- a/src/tools/clippy/Cargo.toml
+++ b/src/tools/clippy/Cargo.toml
@@ -40,7 +40,6 @@ filetime = "0.2"
 rustc-workspace-hack = "1.0"
 
 # UI test dependencies
-clap = { version = "3.1", features = ["derive"] }
 clippy_utils = { path = "clippy_utils" }
 derive-new = "0.5"
 if_chain = "1.0"
diff --git a/src/tools/clippy/tests/compile-test.rs b/src/tools/clippy/tests/compile-test.rs
index 7d219835723..04c2eeff08b 100644
--- a/src/tools/clippy/tests/compile-test.rs
+++ b/src/tools/clippy/tests/compile-test.rs
@@ -23,7 +23,6 @@ const RUN_INTERNAL_TESTS: bool = cfg!(feature = "internal");
 
 /// All crates used in UI tests are listed here
 static TEST_DEPENDENCIES: &[&str] = &[
-    "clap",
     "clippy_utils",
     "derive_new",
     "futures",
@@ -42,8 +41,6 @@ static TEST_DEPENDENCIES: &[&str] = &[
 // Test dependencies may need an `extern crate` here to ensure that they show up
 // in the depinfo file (otherwise cargo thinks they are unused)
 #[allow(unused_extern_crates)]
-extern crate clap;
-#[allow(unused_extern_crates)]
 extern crate clippy_utils;
 #[allow(unused_extern_crates)]
 extern crate derive_new;
diff --git a/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs b/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs
index e370a98df1a..ae2cc2492f4 100644
--- a/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs
+++ b/src/tools/clippy/tests/ui/auxiliary/proc_macro_attr.rs
@@ -20,6 +20,11 @@ use syn::{
 };
 
 #[proc_macro_attribute]
+pub fn dummy(_args: TokenStream, input: TokenStream) -> TokenStream {
+    input
+}
+
+#[proc_macro_attribute]
 pub fn fake_async_trait(_args: TokenStream, input: TokenStream) -> TokenStream {
     let mut item = parse_macro_input!(input as ItemTrait);
     for inner in &mut item.items {
diff --git a/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs b/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs
index d15c84d7438..697412c0027 100644
--- a/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs
+++ b/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.rs
@@ -5,9 +5,6 @@
 #![rustfmt::skip]
 
 #[macro_use]
-extern crate clap;
-
-#[macro_use]
 extern crate proc_macro_attr;
 
 // This should produce a warning
@@ -113,10 +110,10 @@ pub trait Bazz {
     }
 }
 
-#[derive(clap::Parser)]
-#[clap(after_help = "This ia a help message.
+#[derive(Clone, Copy)]
+#[dummy(string = "first line
 
-You're welcome.
+second line
 ")]
 pub struct Args;
 
diff --git a/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.stderr b/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.stderr
index acc3edef9b9..594fca44a32 100644
--- a/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.stderr
+++ b/src/tools/clippy/tests/ui/empty_line_after_outer_attribute.stderr
@@ -1,5 +1,5 @@
 error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
-  --> $DIR/empty_line_after_outer_attribute.rs:14:1
+  --> $DIR/empty_line_after_outer_attribute.rs:11:1
    |
 LL | / #[crate_type = "lib"]
 LL | |
@@ -10,7 +10,7 @@ LL | | fn with_one_newline_and_comment() { assert!(true) }
    = note: `-D clippy::empty-line-after-outer-attr` implied by `-D warnings`
 
 error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
-  --> $DIR/empty_line_after_outer_attribute.rs:26:1
+  --> $DIR/empty_line_after_outer_attribute.rs:23:1
    |
 LL | / #[crate_type = "lib"]
 LL | |
@@ -18,7 +18,7 @@ LL | | fn with_one_newline() { assert!(true) }
    | |_
 
 error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
-  --> $DIR/empty_line_after_outer_attribute.rs:31:1
+  --> $DIR/empty_line_after_outer_attribute.rs:28:1
    |
 LL | / #[crate_type = "lib"]
 LL | |
@@ -27,7 +27,7 @@ LL | | fn with_two_newlines() { assert!(true) }
    | |_
 
 error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
-  --> $DIR/empty_line_after_outer_attribute.rs:38:1
+  --> $DIR/empty_line_after_outer_attribute.rs:35:1
    |
 LL | / #[crate_type = "lib"]
 LL | |
@@ -35,7 +35,7 @@ LL | | enum Baz {
    | |_
 
 error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
-  --> $DIR/empty_line_after_outer_attribute.rs:46:1
+  --> $DIR/empty_line_after_outer_attribute.rs:43:1
    |
 LL | / #[crate_type = "lib"]
 LL | |
@@ -43,7 +43,7 @@ LL | | struct Foo {
    | |_
 
 error: found an empty line after an outer attribute. Perhaps you forgot to add a `!` to make it an inner attribute?
-  --> $DIR/empty_line_after_outer_attribute.rs:54:1
+  --> $DIR/empty_line_after_outer_attribute.rs:51:1
    |
 LL | / #[crate_type = "lib"]
 LL | |