blob: 40806d67487fd6f2e6d22307e187864c66bdd157 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:27:26
|
LL | const BAD32_1: f32 = 0.123_456_789_f32;
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::excessive-precision` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::excessive_precision)]`
help: consider changing the type or truncating it to
|
LL - const BAD32_1: f32 = 0.123_456_789_f32;
LL + const BAD32_1: f32 = 0.123_456_79_f32;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:29:26
|
LL | const BAD32_2: f32 = 0.123_456_789;
| ^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - const BAD32_2: f32 = 0.123_456_789;
LL + const BAD32_2: f32 = 0.123_456_79;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:31:26
|
LL | const BAD32_3: f32 = 0.100_000_000_000_1;
| ^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - const BAD32_3: f32 = 0.100_000_000_000_1;
LL + const BAD32_3: f32 = 0.1;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:33:29
|
LL | const BAD32_EDGE: f32 = 1.000_000_9;
| ^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - const BAD32_EDGE: f32 = 1.000_000_9;
LL + const BAD32_EDGE: f32 = 1.000_001;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:38:26
|
LL | const BAD64_3: f64 = 0.100_000_000_000_000_000_1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - const BAD64_3: f64 = 0.100_000_000_000_000_000_1;
LL + const BAD64_3: f64 = 0.1;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:42:22
|
LL | println!("{:?}", 8.888_888_888_888_888_888_888);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - println!("{:?}", 8.888_888_888_888_888_888_888);
LL + println!("{:?}", 8.888_888_888_888_89);
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:54:22
|
LL | let bad32: f32 = 1.123_456_789;
| ^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let bad32: f32 = 1.123_456_789;
LL + let bad32: f32 = 1.123_456_8;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:56:26
|
LL | let bad32_suf: f32 = 1.123_456_789_f32;
| ^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let bad32_suf: f32 = 1.123_456_789_f32;
LL + let bad32_suf: f32 = 1.123_456_8_f32;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:58:21
|
LL | let bad32_inf = 1.123_456_789_f32;
| ^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let bad32_inf = 1.123_456_789_f32;
LL + let bad32_inf = 1.123_456_8_f32;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:69:36
|
LL | let bad_vec32: Vec<f32> = vec![0.123_456_789];
| ^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let bad_vec32: Vec<f32> = vec![0.123_456_789];
LL + let bad_vec32: Vec<f32> = vec![0.123_456_79];
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:71:36
|
LL | let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_789];
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_789];
LL + let bad_vec64: Vec<f64> = vec![0.123_456_789_123_456_78];
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:76:24
|
LL | let bad_e32: f32 = 1.123_456_788_888e-10;
| ^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let bad_e32: f32 = 1.123_456_788_888e-10;
LL + let bad_e32: f32 = 1.123_456_8e-10;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:80:27
|
LL | let bad_bige32: f32 = 1.123_456_788_888E-10;
| ^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let bad_bige32: f32 = 1.123_456_788_888E-10;
LL + let bad_bige32: f32 = 1.123_456_8E-10;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:93:13
|
LL | let _ = 2.225_073_858_507_201_1e-308_f64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let _ = 2.225_073_858_507_201_1e-308_f64;
LL + let _ = 2.225_073_858_507_201e-308_f64;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:97:13
|
LL | let _ = 1.000_000_000_000_001e-324_f64;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - let _ = 1.000_000_000_000_001e-324_f64;
LL + let _ = 0_f64;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:108:20
|
LL | const _: f64 = 3.0000000000000000e+00;
| ^^^^^^^^^^^^^^^^^^^^^^
|
help: consider changing the type or truncating it to
|
LL - const _: f64 = 3.0000000000000000e+00;
LL + const _: f64 = 3.0;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:113:18
|
LL | let _: f32 = 1.01234567890123456789012345678901234567890;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider making it a `const` item
--> tests/ui/excessive_precision.rs:113:5
|
LL | let _: f32 = 1.01234567890123456789012345678901234567890;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the type or truncating it to
|
LL - let _: f32 = 1.01234567890123456789012345678901234567890;
LL + let _: f32 = 1.012_345_7;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:115:18
|
LL | let _: f64 = 1.01234567890123456789012345678901234567890;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider making it a `const` item
--> tests/ui/excessive_precision.rs:115:5
|
LL | let _: f64 = 1.01234567890123456789012345678901234567890;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the type or truncating it to
|
LL - let _: f64 = 1.01234567890123456789012345678901234567890;
LL + let _: f64 = 1.012_345_678_901_234_6;
|
error: float has excessive precision
--> tests/ui/excessive_precision.rs:127:17
|
LL | let gamma = 0.5772156649015328606065120900824024310421;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: consider making it a `const` item
--> tests/ui/excessive_precision.rs:127:5
|
LL | let gamma = 0.5772156649015328606065120900824024310421;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider changing the type or truncating it to
|
LL - let gamma = 0.5772156649015328606065120900824024310421;
LL + let gamma = 0.577_215_664_901_532_9;
|
error: aborting due to 19 previous errors
|