clean tests/ui/no_effect.rs

Cleaning the empty lines for clarity.
This commit is contained in:
Luis de Bethencourt 2017-05-11 15:26:26 +01:00
parent 47c17e63e7
commit efbaf09308
2 changed files with 83 additions and 121 deletions

View File

@ -63,60 +63,22 @@ fn main() {
unsafe { unsafe_fn() };
Tuple(get_number());
Struct { field: get_number() };
Struct { ..get_struct() };
Enum::Tuple(get_number());
Enum::Struct { field: get_number() };
5 + get_number();
*&get_number();
&get_number();
(5, 6, get_number());
box get_number();
get_number()..;
..get_number();
5..get_number();
[42, get_number()];
[42, 55][get_number() as usize];
(42, get_number()).1;
[get_number(); 55];
[42; 55][get_number() as usize];
{get_number()};
}

View File

@ -166,112 +166,112 @@ note: lint level defined here
4 | #![deny(no_effect, unnecessary_operation)]
| ^^^^^^^^^^^^^^^^^^^^^
error: statement can be reduced
--> $DIR/no_effect.rs:66:5
|
66 | Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:67:5
|
67 | Struct { ..get_struct() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_struct();`
error: statement can be reduced
--> $DIR/no_effect.rs:68:5
|
68 | Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
68 | Enum::Tuple(get_number());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:69:5
|
69 | Enum::Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:70:5
|
70 | 5 + get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:71:5
|
71 | Struct { ..get_struct() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_struct();`
71 | *&get_number();
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:72:5
|
72 | &get_number();
| ^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:73:5
|
73 | (5, 6, get_number());
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `5;6;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:74:5
|
74 | Enum::Tuple(get_number());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
74 | box get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:75:5
|
75 | get_number()..;
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:76:5
|
76 | ..get_number();
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:77:5
|
77 | Enum::Struct { field: get_number() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
77 | 5..get_number();
| ^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:78:5
|
78 | [42, get_number()];
| ^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:79:5
|
79 | [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:80:5
|
80 | 5 + get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();`
80 | (42, get_number()).1;
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:81:5
|
81 | [get_number(); 55];
| ^^^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:82:5
|
82 | [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:83:5
|
83 | *&get_number();
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:86:5
|
86 | &get_number();
| ^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:89:5
|
89 | (5, 6, get_number());
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `5;6;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:92:5
|
92 | box get_number();
| ^^^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:95:5
|
95 | get_number()..;
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:98:5
|
98 | ..get_number();
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:101:5
|
101 | 5..get_number();
| ^^^^^^^^^^^^^^^^ help: replace it with `5;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:104:5
|
104 | [42, get_number()];
| ^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:107:5
|
107 | [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:110:5
|
110 | (42, get_number()).1;
| ^^^^^^^^^^^^^^^^^^^^^ help: replace it with `42;get_number();`
error: statement can be reduced
--> $DIR/no_effect.rs:113:5
|
113 | [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:119:5
|
119 | {get_number()};
83 | {get_number()};
| ^^^^^^^^^^^^^^^ help: replace it with `get_number();`
error: aborting due to 44 previous errors