Fix clippy
This commit is contained in:
parent
9c7ae381e6
commit
37dde3fb58
@ -1,5 +1,5 @@
|
||||
#![feature(let_chains)]
|
||||
#![feature(let_else)]
|
||||
#![cfg_attr(bootstrap, feature(let_else))]
|
||||
#![feature(once_cell)]
|
||||
#![feature(rustc_private)]
|
||||
#![cfg_attr(feature = "deny-warnings", deny(warnings))]
|
||||
|
@ -5,7 +5,7 @@
|
||||
#![feature(drain_filter)]
|
||||
#![feature(iter_intersperse)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(let_else)]
|
||||
#![cfg_attr(bootstrap, feature(let_else))]
|
||||
#![feature(lint_reasons)]
|
||||
#![feature(never_type)]
|
||||
#![feature(once_cell)]
|
||||
|
@ -1,9 +1,9 @@
|
||||
#![feature(array_chunks)]
|
||||
#![feature(box_patterns)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![feature(let_else)]
|
||||
#![feature(let_chains)]
|
||||
#![feature(lint_reasons)]
|
||||
#![cfg_attr(bootstrap, feature(let_else))]
|
||||
#![feature(once_cell)]
|
||||
#![feature(rustc_private)]
|
||||
#![recursion_limit = "512"]
|
||||
|
@ -1,7 +1,6 @@
|
||||
// run-rustfix
|
||||
|
||||
#![feature(lint_reasons)]
|
||||
#![feature(let_else)]
|
||||
#![allow(unused)]
|
||||
#![allow(
|
||||
clippy::if_same_then_else,
|
||||
|
@ -1,7 +1,6 @@
|
||||
// run-rustfix
|
||||
|
||||
#![feature(lint_reasons)]
|
||||
#![feature(let_else)]
|
||||
#![allow(unused)]
|
||||
#![allow(
|
||||
clippy::if_same_then_else,
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:27:5
|
||||
--> $DIR/needless_return.rs:26:5
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
@ -7,217 +7,217 @@ LL | return true;
|
||||
= note: `-D clippy::needless-return` implied by `-D warnings`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:31:5
|
||||
--> $DIR/needless_return.rs:30:5
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:36:9
|
||||
--> $DIR/needless_return.rs:35:9
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:38:9
|
||||
--> $DIR/needless_return.rs:37:9
|
||||
|
|
||||
LL | return false;
|
||||
| ^^^^^^^^^^^^^ help: remove `return`: `false`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:44:17
|
||||
--> $DIR/needless_return.rs:43:17
|
||||
|
|
||||
LL | true => return false,
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `false`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:46:13
|
||||
--> $DIR/needless_return.rs:45:13
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:53:9
|
||||
--> $DIR/needless_return.rs:52:9
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:55:16
|
||||
--> $DIR/needless_return.rs:54:16
|
||||
|
|
||||
LL | let _ = || return true;
|
||||
| ^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:59:5
|
||||
--> $DIR/needless_return.rs:58:5
|
||||
|
|
||||
LL | return the_answer!();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `the_answer!()`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:63:5
|
||||
--> $DIR/needless_return.rs:62:5
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:68:9
|
||||
--> $DIR/needless_return.rs:67:9
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:70:9
|
||||
--> $DIR/needless_return.rs:69:9
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:77:14
|
||||
--> $DIR/needless_return.rs:76:14
|
||||
|
|
||||
LL | _ => return,
|
||||
| ^^^^^^ help: replace `return` with a unit value: `()`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:86:13
|
||||
--> $DIR/needless_return.rs:85:13
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:88:14
|
||||
--> $DIR/needless_return.rs:87:14
|
||||
|
|
||||
LL | _ => return,
|
||||
| ^^^^^^ help: replace `return` with a unit value: `()`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:101:9
|
||||
--> $DIR/needless_return.rs:100:9
|
||||
|
|
||||
LL | return String::from("test");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::from("test")`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:103:9
|
||||
--> $DIR/needless_return.rs:102:9
|
||||
|
|
||||
LL | return String::new();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::new()`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:125:32
|
||||
--> $DIR/needless_return.rs:124:32
|
||||
|
|
||||
LL | bar.unwrap_or_else(|_| return)
|
||||
| ^^^^^^ help: replace `return` with an empty block: `{}`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:130:13
|
||||
--> $DIR/needless_return.rs:129:13
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:132:20
|
||||
--> $DIR/needless_return.rs:131:20
|
||||
|
|
||||
LL | let _ = || return;
|
||||
| ^^^^^^ help: replace `return` with an empty block: `{}`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:138:32
|
||||
--> $DIR/needless_return.rs:137:32
|
||||
|
|
||||
LL | res.unwrap_or_else(|_| return Foo)
|
||||
| ^^^^^^^^^^ help: remove `return`: `Foo`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:147:5
|
||||
--> $DIR/needless_return.rs:146:5
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:151:5
|
||||
--> $DIR/needless_return.rs:150:5
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:156:9
|
||||
--> $DIR/needless_return.rs:155:9
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:158:9
|
||||
--> $DIR/needless_return.rs:157:9
|
||||
|
|
||||
LL | return false;
|
||||
| ^^^^^^^^^^^^^ help: remove `return`: `false`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:164:17
|
||||
--> $DIR/needless_return.rs:163:17
|
||||
|
|
||||
LL | true => return false,
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `false`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:166:13
|
||||
--> $DIR/needless_return.rs:165:13
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:173:9
|
||||
--> $DIR/needless_return.rs:172:9
|
||||
|
|
||||
LL | return true;
|
||||
| ^^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:175:16
|
||||
--> $DIR/needless_return.rs:174:16
|
||||
|
|
||||
LL | let _ = || return true;
|
||||
| ^^^^^^^^^^^ help: remove `return`: `true`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:179:5
|
||||
--> $DIR/needless_return.rs:178:5
|
||||
|
|
||||
LL | return the_answer!();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `the_answer!()`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:183:5
|
||||
--> $DIR/needless_return.rs:182:5
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:188:9
|
||||
--> $DIR/needless_return.rs:187:9
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:190:9
|
||||
--> $DIR/needless_return.rs:189:9
|
||||
|
|
||||
LL | return;
|
||||
| ^^^^^^^ help: remove `return`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:197:14
|
||||
--> $DIR/needless_return.rs:196:14
|
||||
|
|
||||
LL | _ => return,
|
||||
| ^^^^^^ help: replace `return` with a unit value: `()`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:210:9
|
||||
--> $DIR/needless_return.rs:209:9
|
||||
|
|
||||
LL | return String::from("test");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::from("test")`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:212:9
|
||||
--> $DIR/needless_return.rs:211:9
|
||||
|
|
||||
LL | return String::new();
|
||||
| ^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `String::new()`
|
||||
|
||||
error: unneeded `return` statement
|
||||
--> $DIR/needless_return.rs:228:5
|
||||
--> $DIR/needless_return.rs:227:5
|
||||
|
|
||||
LL | return format!("Hello {}", "world!");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `format!("Hello {}", "world!")`
|
||||
|
@ -1,6 +1,5 @@
|
||||
#![warn(clippy::semicolon_if_nothing_returned)]
|
||||
#![allow(clippy::redundant_closure)]
|
||||
#![feature(let_else)]
|
||||
|
||||
fn get_unit() {}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: consider adding a `;` to the last statement for consistent formatting
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:9:5
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:8:5
|
||||
|
|
||||
LL | println!("Hello")
|
||||
| ^^^^^^^^^^^^^^^^^ help: add a `;` here: `println!("Hello");`
|
||||
@ -7,25 +7,25 @@ LL | println!("Hello")
|
||||
= note: `-D clippy::semicolon-if-nothing-returned` implied by `-D warnings`
|
||||
|
||||
error: consider adding a `;` to the last statement for consistent formatting
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:13:5
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:12:5
|
||||
|
|
||||
LL | get_unit()
|
||||
| ^^^^^^^^^^ help: add a `;` here: `get_unit();`
|
||||
|
||||
error: consider adding a `;` to the last statement for consistent formatting
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:18:5
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:17:5
|
||||
|
|
||||
LL | y = x + 1
|
||||
| ^^^^^^^^^ help: add a `;` here: `y = x + 1;`
|
||||
|
||||
error: consider adding a `;` to the last statement for consistent formatting
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:24:9
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:23:9
|
||||
|
|
||||
LL | hello()
|
||||
| ^^^^^^^ help: add a `;` here: `hello();`
|
||||
|
||||
error: consider adding a `;` to the last statement for consistent formatting
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:35:9
|
||||
--> $DIR/semicolon_if_nothing_returned.rs:34:9
|
||||
|
|
||||
LL | ptr::drop_in_place(s.as_mut_ptr())
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: add a `;` here: `ptr::drop_in_place(s.as_mut_ptr());`
|
||||
|
Loading…
Reference in New Issue
Block a user