rust/tests/ui/unnecessary_operation.stderr

130 lines
4.1 KiB
Plaintext
Raw Normal View History

error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:70: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`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_operation)]`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:71: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:72:5
|
2018-12-27 09:57:55 -06:00
LL | Struct { ..get_struct() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_struct();`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:73: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:74: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:75: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:76:5
|
2018-12-27 09:57:55 -06:00
LL | *&get_number();
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:77:5
|
2018-12-27 09:57:55 -06:00
LL | &get_number();
| ^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:78: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:79:5
|
2018-12-27 09:57:55 -06:00
LL | get_number()..;
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:80:5
|
2018-12-27 09:57:55 -06:00
LL | ..get_number();
| ^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:81: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:82: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:83:5
|
LL | [42, 55][get_usize()];
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:84: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:85:5
|
2018-12-27 09:57:55 -06:00
LL | [get_number(); 55];
| ^^^^^^^^^^^^^^^^^^^ help: statement can be reduced to: `get_number();`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:86:5
|
LL | [42; 55][get_usize()];
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42; 55].len() > get_usize());`
error: unnecessary operation
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:87: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
2024-02-17 06:16:29 -06:00
--> tests/ui/unnecessary_operation.rs:90: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: unnecessary operation
--> tests/ui/unnecessary_operation.rs:130:5
|
LL | [42, 55][get_usize()];
| ^^^^^^^^^^^^^^^^^^^^^^ help: statement can be written as: `assert!([42, 55].len() > get_usize());`
error: aborting due to 20 previous errors