rust-clippy/tests/ui/unnecessary_operation.stderr

129 lines
3.8 KiB
Text
Raw Normal View History

error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:54:5
|
2018-12-10 05:27:19 +00:00
54 | Tuple(get_number());
| ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
= note: `-D clippy::unnecessary-operation` implied by `-D warnings`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:55:5
|
2018-12-10 05:27:19 +00:00
55 | Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:56:5
|
2018-12-10 05:27:19 +00:00
56 | Struct { ..get_struct() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_struct();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:57:5
|
2018-12-10 05:27:19 +00:00
57 | Enum::Tuple(get_number());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:58:5
|
2018-12-10 05:27:19 +00:00
58 | Enum::Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:59:5
|
2018-12-10 05:27:19 +00:00
59 | 5 + get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with: `5;get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:60:5
|
2018-12-10 05:27:19 +00:00
60 | *&get_number();
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:61:5
|
2018-12-10 05:27:19 +00:00
61 | &get_number();
| ^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:62:5
|
2018-12-10 05:27:19 +00:00
62 | (5, 6, get_number());
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `5;6;get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:63:5
|
2018-12-10 05:27:19 +00:00
63 | box get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:64:5
|
2018-12-10 05:27:19 +00:00
64 | get_number()..;
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:65:5
|
2018-12-10 05:27:19 +00:00
65 | ..get_number();
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:66:5
|
2018-12-10 05:27:19 +00:00
66 | 5..get_number();
| ^^^^^^^^^^^^^^^^ help: replace it with: `5;get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:67:5
|
2018-12-10 05:27:19 +00:00
67 | [42, get_number()];
| ^^^^^^^^^^^^^^^^^^^ help: replace it with: `42;get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:68:5
|
2018-12-10 05:27:19 +00:00
68 | [42, 55][get_number() as usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `[42, 55];get_number() as usize;`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:69:5
|
2018-12-10 05:27:19 +00:00
69 | (42, get_number()).1;
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `42;get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:70:5
|
2018-12-10 05:27:19 +00:00
70 | [get_number(); 55];
| ^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:71:5
|
2018-12-10 05:27:19 +00:00
71 | [42; 55][get_number() as usize];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `[42; 55];get_number() as usize;`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:72:5
|
2018-12-10 05:27:19 +00:00
72 | / {
73 | | get_number()
74 | | };
| |______^ help: replace it with: `get_number();`
error: statement can be reduced
2018-12-10 05:27:19 +00:00
--> $DIR/unnecessary_operation.rs:75:5
|
2018-12-10 05:27:19 +00:00
75 | / FooString {
76 | | s: String::from("blah"),
77 | | };
| |______^ help: replace it with: `String::from("blah");`
error: aborting due to 20 previous errors