2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:56:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Tuple(get_number());
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
|
|
|
= note: `-D clippy::unnecessary-operation` implied by `-D warnings`
|
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:57:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Struct { field: get_number() };
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:58:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Struct { ..get_struct() };
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_struct();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:59:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Enum::Tuple(get_number());
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:60:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | Enum::Struct { field: get_number() };
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:61:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | 5 + get_number();
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:62:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | *&get_number();
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:63:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | &get_number();
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:64:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | (5, 6, get_number());
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;6;get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:65:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | get_number()..;
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:66:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | ..get_number();
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:67:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | 5..get_number();
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^ help: statement can be reduced to: `5;get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:68:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | [42, get_number()];
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:69:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2019-09-25 12:49:56 -05:00
|
|
|
LL | [42, 55][get_usize()];
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:70:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | (42, get_number()).1;
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `42;get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:71:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | [get_number(); 55];
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:72:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2019-09-25 12:49:56 -05:00
|
|
|
LL | [42; 55][get_usize()];
|
2021-09-08 09:31:47 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42; 55].len() > get_usize());`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:73:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / {
|
|
|
|
LL | | get_number()
|
|
|
|
LL | | };
|
2021-09-08 09:31:47 -05:00
|
|
|
| |______^ help: statement can be reduced to: `get_number();`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2023-03-24 07:34:51 -05:00
|
|
|
--> $DIR/unnecessary_operation.rs:76:5
|
2018-10-27 12:31:47 -05:00
|
|
|
|
|
2018-12-27 09:57:55 -06:00
|
|
|
LL | / FooString {
|
|
|
|
LL | | s: String::from("blah"),
|
|
|
|
LL | | };
|
2021-09-08 09:31:47 -05:00
|
|
|
| |______^ help: statement can be reduced to: `String::from("blah");`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2023-02-27 07:07:44 -06:00
|
|
|
error: aborting due to 19 previous errors
|
2018-10-27 12:31:47 -05:00
|
|
|
|