Skip to content

Commit fbcf7ee

Browse files
author
Michael Wright
committed
Add [rustfmt::skip] to unused_unit test
1 parent 131c8f6 commit fbcf7ee

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

ci/base-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ rustup override set nightly
5959
# avoid loop spam and allow cmds with exit status != 0
6060
set +ex
6161

62-
for file in `find tests -not -path "tests/ui/unused_unit.rs" | grep "\.rs$"` ; do
62+
for file in `find tests | grep "\.rs$"` ; do
6363
rustfmt ${file} --check
6464
if [ $? -ne 0 ]; then
6565
echo "${file} needs reformatting!"

tests/ui/unused_unit.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
#![deny(clippy::unused_unit)]
1010
#![allow(clippy::needless_return)]
11+
#![feature(custom_inner_attributes)]
12+
#![rustfmt::skip]
1113

1214
struct Unitter;
1315
impl Unitter {

tests/ui/unused_unit.stderr

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: unneeded unit return type
2-
--> $DIR/unused_unit.rs:15:59
2+
--> $DIR/unused_unit.rs:17:59
33
|
44
LL | pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) ->
55
| ___________________________________________________________^
@@ -13,37 +13,37 @@ LL | #![deny(clippy::unused_unit)]
1313
| ^^^^^^^^^^^^^^^^^^^
1414

1515
error: unneeded unit return type
16-
--> $DIR/unused_unit.rs:25:19
16+
--> $DIR/unused_unit.rs:27:19
1717
|
1818
LL | fn into(self) -> () {
1919
| ^^^^^ help: remove the `-> ()`
2020

2121
error: unneeded unit expression
22-
--> $DIR/unused_unit.rs:26:9
22+
--> $DIR/unused_unit.rs:28:9
2323
|
2424
LL | ()
2525
| ^^ help: remove the final `()`
2626

2727
error: unneeded unit return type
28-
--> $DIR/unused_unit.rs:30:18
28+
--> $DIR/unused_unit.rs:32:18
2929
|
3030
LL | fn return_unit() -> () { () }
3131
| ^^^^^ help: remove the `-> ()`
3232

3333
error: unneeded unit expression
34-
--> $DIR/unused_unit.rs:30:26
34+
--> $DIR/unused_unit.rs:32:26
3535
|
3636
LL | fn return_unit() -> () { () }
3737
| ^^ help: remove the final `()`
3838

3939
error: unneeded `()`
40-
--> $DIR/unused_unit.rs:37:14
40+
--> $DIR/unused_unit.rs:39:14
4141
|
4242
LL | break();
4343
| ^^ help: remove the `()`
4444

4545
error: unneeded `()`
46-
--> $DIR/unused_unit.rs:39:11
46+
--> $DIR/unused_unit.rs:41:11
4747
|
4848
LL | return();
4949
| ^^ help: remove the `()`

0 commit comments

Comments
 (0)