2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:26:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-08-01 09:30:44 -05:00
|
|
|
= note: `-D clippy::needless-return` implied by `-D warnings`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:30:5
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:35:5
|
2023-01-27 14:09:08 -06:00
|
|
|
|
|
|
|
|
LL | return true;;;
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;;;
|
|
|
|
LL + true
|
|
|
|
|
|
2023-01-27 14:09:08 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:40:5
|
2023-01-27 14:09:08 -06:00
|
|
|
|
|
|
|
|
LL | return true;; ; ;
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;; ; ;
|
|
|
|
LL + true
|
|
|
|
|
|
2023-01-27 14:09:08 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:45:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:47:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | return false;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return false;
|
|
|
|
LL + false
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:53:17
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | true => return false,
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL | true => false,
|
|
|
|
| ~~~~~
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:55:13
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:62:9
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:64:16
|
2017-02-07 14:05:30 -06:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | let _ = || return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL | let _ = || true;
|
|
|
|
| ~~~~
|
2017-02-07 14:05:30 -06:00
|
|
|
|
2022-06-04 06:34:07 -05:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:68:5
|
2022-06-04 06:34:07 -05:00
|
|
|
|
|
|
|
|
LL | return the_answer!();
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return the_answer!();
|
|
|
|
LL + the_answer!()
|
|
|
|
|
|
2022-06-04 06:34:07 -05:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:71:21
|
2019-06-19 07:56:02 -05:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | fn test_void_fun() {
|
|
|
|
| _____________________^
|
|
|
|
LL | | return;
|
|
|
|
| |__________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - fn test_void_fun() {
|
|
|
|
LL - return;
|
|
|
|
LL + fn test_void_fun() {
|
|
|
|
|
|
2019-06-19 07:56:02 -05:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:76:11
|
2019-06-19 07:56:02 -05:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | if b {
|
|
|
|
| ___________^
|
|
|
|
LL | | return;
|
|
|
|
| |______________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - if b {
|
|
|
|
LL - return;
|
|
|
|
LL + if b {
|
|
|
|
|
|
2019-06-19 07:56:02 -05:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:78:13
|
2019-06-19 07:56:02 -05:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | } else {
|
|
|
|
| _____________^
|
|
|
|
LL | | return;
|
|
|
|
| |______________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - } else {
|
|
|
|
LL - return;
|
|
|
|
LL + } else {
|
|
|
|
|
|
2019-06-19 07:56:02 -05:00
|
|
|
|
2020-01-06 00:36:33 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:86:14
|
2019-06-20 06:44:00 -05:00
|
|
|
|
|
|
|
|
LL | _ => return,
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: replace `return` with a unit value
|
|
|
|
|
|
|
|
|
LL | _ => (),
|
|
|
|
| ~~
|
2019-06-20 06:44:00 -05:00
|
|
|
|
2020-08-28 09:10:16 -05:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:94:24
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | let _ = 42;
|
|
|
|
| ________________________^
|
|
|
|
LL | | return;
|
|
|
|
| |__________________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - let _ = 42;
|
|
|
|
LL - return;
|
|
|
|
LL + let _ = 42;
|
|
|
|
|
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:97:14
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
|
LL | _ => return,
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: replace `return` with a unit value
|
|
|
|
|
|
|
|
|
LL | _ => (),
|
|
|
|
| ~~
|
2021-12-30 08:10:43 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:110:9
|
2020-08-28 09:10:16 -05:00
|
|
|
|
|
|
|
|
LL | return String::from("test");
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return String::from("test");
|
|
|
|
LL + String::from("test")
|
|
|
|
|
|
2020-08-28 09:10:16 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:112:9
|
2020-08-28 09:10:16 -05:00
|
|
|
|
|
|
|
|
LL | return String::new();
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return String::new();
|
|
|
|
LL + String::new()
|
|
|
|
|
|
2020-08-28 09:10:16 -05:00
|
|
|
|
2021-01-30 11:06:34 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:134:32
|
2021-01-30 11:06:34 -06:00
|
|
|
|
|
|
|
|
LL | bar.unwrap_or_else(|_| return)
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: replace `return` with an empty block
|
|
|
|
|
|
|
|
|
LL | bar.unwrap_or_else(|_| {})
|
|
|
|
| ~~
|
2021-01-30 11:06:34 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:138:21
|
2021-01-30 11:06:34 -06:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | let _ = || {
|
|
|
|
| _____________________^
|
|
|
|
LL | | return;
|
|
|
|
| |__________________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - let _ = || {
|
|
|
|
LL - return;
|
|
|
|
LL + let _ = || {
|
|
|
|
|
|
2021-01-30 11:06:34 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:141:20
|
2021-01-30 11:06:34 -06:00
|
|
|
|
|
|
|
|
LL | let _ = || return;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: replace `return` with an empty block
|
|
|
|
|
|
|
|
|
LL | let _ = || {};
|
|
|
|
| ~~
|
2021-01-30 11:06:34 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:147:32
|
2021-01-30 11:06:34 -06:00
|
|
|
|
|
|
|
|
LL | res.unwrap_or_else(|_| return Foo)
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL | res.unwrap_or_else(|_| Foo)
|
|
|
|
| ~~~
|
2021-01-30 11:06:34 -06:00
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:156:5
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:160:5
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:165:9
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:167:9
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return false;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return false;
|
|
|
|
LL + false
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:173:17
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | true => return false,
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL | true => false,
|
|
|
|
| ~~~~~
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:175:13
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:182:9
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return true;
|
|
|
|
LL + true
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:184:16
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | let _ = || return true;
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL | let _ = || true;
|
|
|
|
| ~~~~
|
2021-04-22 04:31:13 -05:00
|
|
|
|
2022-06-04 06:34:07 -05:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:188:5
|
2022-06-04 06:34:07 -05:00
|
|
|
|
|
|
|
|
LL | return the_answer!();
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return the_answer!();
|
|
|
|
LL + the_answer!()
|
|
|
|
|
|
2022-06-04 06:34:07 -05:00
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:191:33
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | async fn async_test_void_fun() {
|
|
|
|
| _________________________________^
|
|
|
|
LL | | return;
|
|
|
|
| |__________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - async fn async_test_void_fun() {
|
|
|
|
LL - return;
|
|
|
|
LL + async fn async_test_void_fun() {
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:196:11
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | if b {
|
|
|
|
| ___________^
|
|
|
|
LL | | return;
|
|
|
|
| |______________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - if b {
|
|
|
|
LL - return;
|
|
|
|
LL + if b {
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:198:13
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
LL | } else {
|
|
|
|
| _____________^
|
|
|
|
LL | | return;
|
|
|
|
| |______________^
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - } else {
|
|
|
|
LL - return;
|
|
|
|
LL + } else {
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:206:14
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | _ => return,
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: replace `return` with a unit value
|
|
|
|
|
|
|
|
|
LL | _ => (),
|
|
|
|
| ~~
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:219:9
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return String::from("test");
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return String::from("test");
|
|
|
|
LL + String::from("test")
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:221:9
|
2021-04-22 04:31:13 -05:00
|
|
|
|
|
|
|
|
LL | return String::new();
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return String::new();
|
|
|
|
LL + String::new()
|
|
|
|
|
|
2021-04-22 04:31:13 -05:00
|
|
|
|
2022-06-04 06:34:07 -05:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:237:5
|
2022-06-04 06:34:07 -05:00
|
|
|
|
|
|
|
|
LL | return format!("Hello {}", "world!");
|
2022-10-06 02:44:38 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return format!("Hello {}", "world!");
|
|
|
|
LL + format!("Hello {}", "world!")
|
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:249:9
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | return true;
|
|
|
|
| ^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL ~ true
|
|
|
|
LL | } else {
|
|
|
|
LL | return false;
|
|
|
|
LL ~ }
|
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:251:9
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | return false;
|
|
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL ~ false
|
|
|
|
LL ~ }
|
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:258:13
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | return 10;
|
|
|
|
| ^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL ~ 10
|
|
|
|
LL | },
|
|
|
|
...
|
|
|
|
LL | },
|
|
|
|
LL ~ }
|
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:261:13
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | return 100;
|
|
|
|
| ^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL ~ 100
|
|
|
|
LL | },
|
|
|
|
LL ~ }
|
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:269:9
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | return 0;
|
|
|
|
| ^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL ~ 0
|
|
|
|
LL ~ }
|
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:276:13
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | return *(x as *const isize);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL ~ *(x as *const isize)
|
|
|
|
LL | } else {
|
|
|
|
LL | return !*(x as *const isize);
|
|
|
|
LL ~ }
|
|
|
|
LL ~ }
|
|
|
|
|
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:278:13
|
2022-10-06 02:44:38 -05:00
|
|
|
|
|
|
|
|
LL | return !*(x as *const isize);
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL ~ !*(x as *const isize)
|
|
|
|
LL ~ }
|
|
|
|
LL ~ }
|
|
|
|
|
|
2022-06-04 06:34:07 -05:00
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:285:20
|
2022-12-01 11:29:38 -06:00
|
|
|
|
|
|
|
|
LL | let _ = 42;
|
|
|
|
| ____________________^
|
|
|
|
LL | |
|
|
|
|
LL | | return;
|
|
|
|
| |______________^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - let _ = 42;
|
|
|
|
LL -
|
|
|
|
LL - return;
|
|
|
|
LL + let _ = 42;
|
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:292:20
|
2022-12-01 11:29:38 -06:00
|
|
|
|
|
|
|
|
LL | let _ = 42; return;
|
|
|
|
| ^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - let _ = 42; return;
|
|
|
|
LL + let _ = 42;
|
|
|
|
|
|
2022-12-01 11:29:38 -06:00
|
|
|
|
2023-01-12 12:48:13 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:304:9
|
2023-01-12 12:48:13 -06:00
|
|
|
|
|
|
|
|
LL | return Ok(format!("ok!"));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return Ok(format!("ok!"));
|
|
|
|
LL + Ok(format!("ok!"))
|
|
|
|
|
|
2023-01-12 12:48:13 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:306:9
|
2023-01-12 12:48:13 -06:00
|
|
|
|
|
|
|
|
LL | return Err(format!("err!"));
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return Err(format!("err!"));
|
|
|
|
LL + Err(format!("err!"))
|
|
|
|
|
|
2023-01-12 12:48:13 -06:00
|
|
|
|
2023-02-25 18:08:29 -06:00
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:312:9
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
|
|
|
LL | return if true { 1 } else { 2 };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return`
|
|
|
|
|
|
|
|
|
LL - return if true { 1 } else { 2 };
|
|
|
|
LL + if true { 1 } else { 2 }
|
|
|
|
|
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
|
|
error: unneeded `return` statement
|
2024-02-27 08:25:18 -06:00
|
|
|
--> tests/ui/needless_return.rs:316:9
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
|
|
|
LL | return if b1 { 0 } else { 1 } | if b2 { 2 } else { 3 } | if b3 { 4 } else { 5 };
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-06-02 04:41:57 -05:00
|
|
|
help: remove `return` and wrap the sequence with parentheses
|
|
|
|
|
|
|
|
|
LL - return if b1 { 0 } else { 1 } | if b2 { 2 } else { 3 } | if b3 { 4 } else { 5 };
|
|
|
|
LL + (if b1 { 0 } else { 1 } | if b2 { 2 } else { 3 } | if b3 { 4 } else { 5 })
|
|
|
|
|
|
2023-02-25 18:08:29 -06:00
|
|
|
|
|
|
|
error: aborting due to 52 previous errors
|
2018-01-16 10:06:27 -06:00
|
|
|
|