rust/tests/ui/needless_return.stderr
2023-05-23 23:47:04 +00:00

657 lines
13 KiB
Plaintext

error: unneeded `return` statement
--> $DIR/needless_return.rs:28:5
|
LL | return true;
| ^^^^^^^^^^^
|
= note: `-D clippy::needless-return` implied by `-D warnings`
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:32:5
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:37:5
|
LL | return true;;;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;;;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:42:5
|
LL | return true;; ; ;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;; ; ;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:47:9
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:49:9
|
LL | return false;
| ^^^^^^^^^^^^
|
help: remove `return`
|
LL - return false;
LL + false
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:55:17
|
LL | true => return false,
| ^^^^^^^^^^^^
|
help: remove `return`
|
LL | true => false,
| ~~~~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:57:13
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:64:9
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:66:16
|
LL | let _ = || return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL | let _ = || true;
| ~~~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:70:5
|
LL | return the_answer!();
| ^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return the_answer!();
LL + the_answer!()
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:73:21
|
LL | fn test_void_fun() {
| _____________________^
LL | | return;
| |__________^
|
help: remove `return`
|
LL - fn test_void_fun() {
LL - return;
LL + fn test_void_fun() {
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:78:11
|
LL | if b {
| ___________^
LL | | return;
| |______________^
|
help: remove `return`
|
LL - if b {
LL - return;
LL + if b {
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:80:13
|
LL | } else {
| _____________^
LL | | return;
| |______________^
|
help: remove `return`
|
LL - } else {
LL - return;
LL + } else {
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:88:14
|
LL | _ => return,
| ^^^^^^
|
help: replace `return` with a unit value
|
LL | _ => (),
| ~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:96:24
|
LL | let _ = 42;
| ________________________^
LL | | return;
| |__________________^
|
help: remove `return`
|
LL - let _ = 42;
LL - return;
LL + let _ = 42;
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:99:14
|
LL | _ => return,
| ^^^^^^
|
help: replace `return` with a unit value
|
LL | _ => (),
| ~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:112:9
|
LL | return String::from("test");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return String::from("test");
LL + String::from("test")
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:114:9
|
LL | return String::new();
| ^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return String::new();
LL + String::new()
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:136:32
|
LL | bar.unwrap_or_else(|_| return)
| ^^^^^^
|
help: replace `return` with an empty block
|
LL | bar.unwrap_or_else(|_| {})
| ~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:140:21
|
LL | let _ = || {
| _____________________^
LL | | return;
| |__________________^
|
help: remove `return`
|
LL - let _ = || {
LL - return;
LL + let _ = || {
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:143:20
|
LL | let _ = || return;
| ^^^^^^
|
help: replace `return` with an empty block
|
LL | let _ = || {};
| ~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:149:32
|
LL | res.unwrap_or_else(|_| return Foo)
| ^^^^^^^^^^
|
help: remove `return`
|
LL | res.unwrap_or_else(|_| Foo)
| ~~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:158:5
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:162:5
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:167:9
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:169:9
|
LL | return false;
| ^^^^^^^^^^^^
|
help: remove `return`
|
LL - return false;
LL + false
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:175:17
|
LL | true => return false,
| ^^^^^^^^^^^^
|
help: remove `return`
|
LL | true => false,
| ~~~~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:177:13
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:184:9
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL - return true;
LL + true
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:186:16
|
LL | let _ = || return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL | let _ = || true;
| ~~~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:190:5
|
LL | return the_answer!();
| ^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return the_answer!();
LL + the_answer!()
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:193:33
|
LL | async fn async_test_void_fun() {
| _________________________________^
LL | | return;
| |__________^
|
help: remove `return`
|
LL - async fn async_test_void_fun() {
LL - return;
LL + async fn async_test_void_fun() {
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:198:11
|
LL | if b {
| ___________^
LL | | return;
| |______________^
|
help: remove `return`
|
LL - if b {
LL - return;
LL + if b {
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:200:13
|
LL | } else {
| _____________^
LL | | return;
| |______________^
|
help: remove `return`
|
LL - } else {
LL - return;
LL + } else {
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:208:14
|
LL | _ => return,
| ^^^^^^
|
help: replace `return` with a unit value
|
LL | _ => (),
| ~~
error: unneeded `return` statement
--> $DIR/needless_return.rs:221:9
|
LL | return String::from("test");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return String::from("test");
LL + String::from("test")
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:223:9
|
LL | return String::new();
| ^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return String::new();
LL + String::new()
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:239:5
|
LL | return format!("Hello {}", "world!");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return format!("Hello {}", "world!");
LL + format!("Hello {}", "world!")
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:251:9
|
LL | return true;
| ^^^^^^^^^^^
|
help: remove `return`
|
LL ~ true
LL | } else {
LL | return false;
LL ~ }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:253:9
|
LL | return false;
| ^^^^^^^^^^^^
|
help: remove `return`
|
LL ~ false
LL ~ }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:260:13
|
LL | return 10;
| ^^^^^^^^^
|
help: remove `return`
|
LL ~ 10
LL | },
...
LL | },
LL ~ }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:263:13
|
LL | return 100;
| ^^^^^^^^^^
|
help: remove `return`
|
LL ~ 100
LL | },
LL ~ }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:271:9
|
LL | return 0;
| ^^^^^^^^
|
help: remove `return`
|
LL ~ 0
LL ~ }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:278:13
|
LL | return *(x as *const isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL ~ *(x as *const isize)
LL | } else {
LL | return !*(x as *const isize);
LL ~ }
LL ~ }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:280:13
|
LL | return !*(x as *const isize);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL ~ !*(x as *const isize)
LL ~ }
LL ~ }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:287:20
|
LL | let _ = 42;
| ____________________^
LL | |
LL | | return;
| |______________^
|
help: remove `return`
|
LL - let _ = 42;
LL -
LL - return;
LL + let _ = 42;
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:294:20
|
LL | let _ = 42; return;
| ^^^^^^^
|
help: remove `return`
|
LL - let _ = 42; return;
LL + let _ = 42;
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:306:9
|
LL | return Ok(format!("ok!"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return Ok(format!("ok!"));
LL + Ok(format!("ok!"))
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:308:9
|
LL | return Err(format!("err!"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return Err(format!("err!"));
LL + Err(format!("err!"))
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:314:9
|
LL | return if true { 1 } else { 2 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: remove `return`
|
LL - return if true { 1 } else { 2 };
LL + if true { 1 } else { 2 }
|
error: unneeded `return` statement
--> $DIR/needless_return.rs:318:9
|
LL | return if b1 { 0 } else { 1 } | if b2 { 2 } else { 3 } | if b3 { 4 } else { 5 };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
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 })
|
error: aborting due to 52 previous errors