rust/tests/ui/unnecessary_operation.stderr

123 lines
3.7 KiB
Plaintext
Raw Normal View History

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