-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #4220 - d-dorazio:4182-needless-return-void-functions, …
…r=flip1995 make needless_return work with void functions fixes #4181. changelog: make needless_return work with void functions. I don't think the failure is related to my changes, but I'm not sure 🤔
- Loading branch information
Showing
7 changed files
with
143 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,76 @@ | ||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:8:5 | ||
--> $DIR/needless_return.rs:14:5 | ||
| | ||
LL | return true; | ||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true` | ||
| ^^^^^^^^^^^^ help: remove `return`: `true` | ||
| | ||
= note: `-D clippy::needless-return` implied by `-D warnings` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:12:5 | ||
--> $DIR/needless_return.rs:18:5 | ||
| | ||
LL | return true; | ||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true` | ||
| ^^^^^^^^^^^^ help: remove `return`: `true` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:17:9 | ||
--> $DIR/needless_return.rs:23:9 | ||
| | ||
LL | return true; | ||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true` | ||
| ^^^^^^^^^^^^ help: remove `return`: `true` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:19:9 | ||
--> $DIR/needless_return.rs:25:9 | ||
| | ||
LL | return false; | ||
| ^^^^^^^^^^^^^ help: remove `return` as shown: `false` | ||
| ^^^^^^^^^^^^^ help: remove `return`: `false` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:25:17 | ||
--> $DIR/needless_return.rs:31:17 | ||
| | ||
LL | true => return false, | ||
| ^^^^^^^^^^^^ help: remove `return` as shown: `false` | ||
| ^^^^^^^^^^^^ help: remove `return`: `false` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:27:13 | ||
--> $DIR/needless_return.rs:33:13 | ||
| | ||
LL | return true; | ||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true` | ||
| ^^^^^^^^^^^^ help: remove `return`: `true` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:34:9 | ||
--> $DIR/needless_return.rs:40:9 | ||
| | ||
LL | return true; | ||
| ^^^^^^^^^^^^ help: remove `return` as shown: `true` | ||
| ^^^^^^^^^^^^ help: remove `return`: `true` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:36:16 | ||
--> $DIR/needless_return.rs:42:16 | ||
| | ||
LL | let _ = || return true; | ||
| ^^^^^^^^^^^ help: remove `return` as shown: `true` | ||
| ^^^^^^^^^^^ help: remove `return`: `true` | ||
|
||
error: aborting due to 8 previous errors | ||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:50:5 | ||
| | ||
LL | return; | ||
| ^^^^^^^ help: remove `return` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:55:9 | ||
| | ||
LL | return; | ||
| ^^^^^^^ help: remove `return` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:57:9 | ||
| | ||
LL | return; | ||
| ^^^^^^^ help: remove `return` | ||
|
||
error: unneeded return statement | ||
--> $DIR/needless_return.rs:64:14 | ||
| | ||
LL | _ => return, | ||
| ^^^^^^ help: replace `return` with the unit type: `()` | ||
|
||
error: aborting due to 12 previous errors | ||
|