2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:70: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`
|
2023-08-01 07:02:21 -05:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_operation)]`
|
2018-10-27 12:31:47 -05:00
|
|
|
|
2021-09-08 09:31:47 -05:00
|
|
|
error: unnecessary operation
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:71: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:72: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:73: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:74: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:75: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:76: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:77: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:78: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:79: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:80: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:81: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:82: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:83: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:84: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:85: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:86: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:87: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
|
2024-02-17 06:16:29 -06:00
|
|
|
--> tests/ui/unnecessary_operation.rs:90: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
|
|
|
|