about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xci/base-tests.sh2
-rw-r--r--tests/ui/unused_unit.rs2
-rw-r--r--tests/ui/unused_unit.stderr14
3 files changed, 10 insertions, 8 deletions
diff --git a/ci/base-tests.sh b/ci/base-tests.sh
index 26b04602a6f..ec860de9358 100755
--- a/ci/base-tests.sh
+++ b/ci/base-tests.sh
@@ -59,7 +59,7 @@ rustup override set nightly
 # avoid loop spam and allow cmds with exit status != 0
 set +ex
 
-for file in `find tests -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
+for file in `find tests | grep "\.rs$"` ; do
   rustfmt ${file} --check
   if [ $? -ne 0 ]; then
     echo "${file} needs reformatting!"
diff --git a/tests/ui/unused_unit.rs b/tests/ui/unused_unit.rs
index 8d56d2051e2..6d6ecd105c6 100644
--- a/tests/ui/unused_unit.rs
+++ b/tests/ui/unused_unit.rs
@@ -8,6 +8,8 @@
 
 #![deny(clippy::unused_unit)]
 #![allow(clippy::needless_return)]
+#![feature(custom_inner_attributes)]
+#![rustfmt::skip]
 
 struct Unitter;
 impl Unitter {
diff --git a/tests/ui/unused_unit.stderr b/tests/ui/unused_unit.stderr
index c4cb643cb71..92098925ac1 100644
--- a/tests/ui/unused_unit.stderr
+++ b/tests/ui/unused_unit.stderr
@@ -1,5 +1,5 @@
 error: unneeded unit return type
-  --> $DIR/unused_unit.rs:15:59
+  --> $DIR/unused_unit.rs:17:59
    |
 LL |       pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) ->
    |  ___________________________________________________________^
@@ -13,37 +13,37 @@ LL | #![deny(clippy::unused_unit)]
    |         ^^^^^^^^^^^^^^^^^^^
 
 error: unneeded unit return type
-  --> $DIR/unused_unit.rs:25:19
+  --> $DIR/unused_unit.rs:27:19
    |
 LL |     fn into(self) -> () {
    |                   ^^^^^ help: remove the `-> ()`
 
 error: unneeded unit expression
-  --> $DIR/unused_unit.rs:26:9
+  --> $DIR/unused_unit.rs:28:9
    |
 LL |         ()
    |         ^^ help: remove the final `()`
 
 error: unneeded unit return type
-  --> $DIR/unused_unit.rs:30:18
+  --> $DIR/unused_unit.rs:32:18
    |
 LL | fn return_unit() -> () { () }
    |                  ^^^^^ help: remove the `-> ()`
 
 error: unneeded unit expression
-  --> $DIR/unused_unit.rs:30:26
+  --> $DIR/unused_unit.rs:32:26
    |
 LL | fn return_unit() -> () { () }
    |                          ^^ help: remove the final `()`
 
 error: unneeded `()`
-  --> $DIR/unused_unit.rs:37:14
+  --> $DIR/unused_unit.rs:39:14
    |
 LL |         break();
    |              ^^ help: remove the `()`
 
 error: unneeded `()`
-  --> $DIR/unused_unit.rs:39:11
+  --> $DIR/unused_unit.rs:41:11
    |
 LL |     return();
    |           ^^ help: remove the `()`