mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 07:00:55 +00:00
Add [rustfmt::skip]
to unused_unit
test
This commit is contained in:
parent
131c8f6bf2
commit
fbcf7eefb9
3 changed files with 10 additions and 8 deletions
|
@ -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!"
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
|
||||
#![deny(clippy::unused_unit)]
|
||||
#![allow(clippy::needless_return)]
|
||||
#![feature(custom_inner_attributes)]
|
||||
#![rustfmt::skip]
|
||||
|
||||
struct Unitter;
|
||||
impl Unitter {
|
||||
|
|
|
@ -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 `()`
|
||||
|
|
Loading…
Reference in a new issue