2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:70:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | Tuple(get_number());
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-operation` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_operation)]`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:71:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | Struct { field: get_number() };
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:72:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | Struct { ..get_struct() };
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_struct();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:73:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | Enum::Tuple(get_number());
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:74:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | Enum::Struct { field: get_number() };
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:75:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | 5 + get_number();
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:76:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | *&get_number();
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:77:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | &get_number();
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:78:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | (5, 6, get_number());
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;6;get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:79:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | get_number()..;
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:80:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | ..get_number();
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:81:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | 5..get_number();
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:82:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | [42, get_number()];
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:83:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2019-09-25 17:49:56 +00:00
|
|
|
LL | [42, 55][get_usize()];
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:84:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | (42, get_number()).1;
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:85:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | [get_number(); 55];
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:86:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2019-09-25 17:49:56 +00:00
|
|
|
LL | [42; 55][get_usize()];
|
2021-09-08 14:31:47 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42; 55].len() > get_usize());`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:87:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / {
|
|
|
|
LL | | get_number()
|
|
|
|
LL | | };
|
2021-09-08 14:31:47 +00:00
|
|
|
| |______^ help: statement can be reduced to: `get_number();`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2021-09-08 14:31:47 +00:00
|
|
|
error: unnecessary operation
|
2023-12-16 13:12:50 +00:00
|
|
|
--> $DIR/unnecessary_operation.rs:90:5
|
2018-10-27 17:31:47 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | / FooString {
|
|
|
|
LL | | s: String::from("blah"),
|
|
|
|
LL | | };
|
2021-09-08 14:31:47 +00:00
|
|
|
| |______^ help: statement can be reduced to: `String::from("blah");`
|
2018-10-27 17:31:47 +00:00
|
|
|
|
2023-02-27 13:07:44 +00:00
|
|
|
error: aborting due to 19 previous errors
|
2018-10-27 17:31:47 +00:00
|
|
|
|