mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-30 16:39:26 +00:00
276 lines
6.3 KiB
Text
276 lines
6.3 KiB
Text
error: statement with no effect
|
|
--> $DIR/no_effect.rs:61:5
|
|
|
|
|
61 | 0;
|
|
| ^^
|
|
|
|
|
= note: `-D clippy::no-effect` implied by `-D warnings`
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:62:5
|
|
|
|
|
62 | s2;
|
|
| ^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:63:5
|
|
|
|
|
63 | Unit;
|
|
| ^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:64:5
|
|
|
|
|
64 | Tuple(0);
|
|
| ^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:65:5
|
|
|
|
|
65 | Struct { field: 0 };
|
|
| ^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:66:5
|
|
|
|
|
66 | Struct { ..s };
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:67:5
|
|
|
|
|
67 | Union { a: 0 };
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:68:5
|
|
|
|
|
68 | Enum::Tuple(0);
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:69:5
|
|
|
|
|
69 | Enum::Struct { field: 0 };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:70:5
|
|
|
|
|
70 | 5 + 6;
|
|
| ^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:71:5
|
|
|
|
|
71 | *&42;
|
|
| ^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:72:5
|
|
|
|
|
72 | &6;
|
|
| ^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:73:5
|
|
|
|
|
73 | (5, 6, 7);
|
|
| ^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:74:5
|
|
|
|
|
74 | box 42;
|
|
| ^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:75:5
|
|
|
|
|
75 | ..;
|
|
| ^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:76:5
|
|
|
|
|
76 | 5..;
|
|
| ^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:77:5
|
|
|
|
|
77 | ..5;
|
|
| ^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:78:5
|
|
|
|
|
78 | 5..6;
|
|
| ^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:80:5
|
|
|
|
|
80 | [42, 55];
|
|
| ^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:81:5
|
|
|
|
|
81 | [42, 55][1];
|
|
| ^^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:82:5
|
|
|
|
|
82 | (42, 55).1;
|
|
| ^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:83:5
|
|
|
|
|
83 | [42; 55];
|
|
| ^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:84:5
|
|
|
|
|
84 | [42; 55][13];
|
|
| ^^^^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:86:5
|
|
|
|
|
86 | || x += 5;
|
|
| ^^^^^^^^^^
|
|
|
|
error: statement with no effect
|
|
--> $DIR/no_effect.rs:88:5
|
|
|
|
|
88 | FooString { s: s };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:99:5
|
|
|
|
|
99 | Tuple(get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
|
= note: `-D clippy::unnecessary-operation` implied by `-D warnings`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:100:5
|
|
|
|
|
100 | Struct { field: get_number() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:101:5
|
|
|
|
|
101 | Struct { ..get_struct() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_struct();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:102:5
|
|
|
|
|
102 | Enum::Tuple(get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:103:5
|
|
|
|
|
103 | Enum::Struct { field: get_number() };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:104:5
|
|
|
|
|
104 | 5 + get_number();
|
|
| ^^^^^^^^^^^^^^^^^ help: replace it with: `5;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:105:5
|
|
|
|
|
105 | *&get_number();
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:106:5
|
|
|
|
|
106 | &get_number();
|
|
| ^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:107:5
|
|
|
|
|
107 | (5, 6, get_number());
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `5;6;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:108:5
|
|
|
|
|
108 | box get_number();
|
|
| ^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:109:5
|
|
|
|
|
109 | get_number()..;
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:110:5
|
|
|
|
|
110 | ..get_number();
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:111:5
|
|
|
|
|
111 | 5..get_number();
|
|
| ^^^^^^^^^^^^^^^^ help: replace it with: `5;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:112:5
|
|
|
|
|
112 | [42, get_number()];
|
|
| ^^^^^^^^^^^^^^^^^^^ help: replace it with: `42;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:113:5
|
|
|
|
|
113 | [42, 55][get_number() as usize];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `[42, 55];get_number() as usize;`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:114:5
|
|
|
|
|
114 | (42, get_number()).1;
|
|
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `42;get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:115:5
|
|
|
|
|
115 | [get_number(); 55];
|
|
| ^^^^^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:116:5
|
|
|
|
|
116 | [42; 55][get_number() as usize];
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `[42; 55];get_number() as usize;`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:117:5
|
|
|
|
|
117 | {get_number()};
|
|
| ^^^^^^^^^^^^^^^ help: replace it with: `get_number();`
|
|
|
|
error: statement can be reduced
|
|
--> $DIR/no_effect.rs:118:5
|
|
|
|
|
118 | FooString { s: String::from("blah"), };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `String::from("blah");`
|
|
|
|
error: aborting due to 45 previous errors
|
|
|