From fbcf7eefb91b687e927a273e42380623b750d31a Mon Sep 17 00:00:00 2001 From: Michael Wright Date: Thu, 7 Mar 2019 08:13:59 +0200 Subject: [PATCH] Add `[rustfmt::skip]` to `unused_unit` test --- ci/base-tests.sh | 2 +- tests/ui/unused_unit.rs | 2 ++ tests/ui/unused_unit.stderr | 14 +++++++------- 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 (), 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 `()`