@@ -2,7 +2,7 @@ error: float has excessive precision
2
2
--> $DIR/excessive_precision.rs:15:26
3
3
|
4
4
LL | const BAD32_1: f32 = 0.123_456_789_f32;
5
- | ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_79 `
5
+ | ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_79_f32 `
6
6
|
7
7
= note: `-D clippy::excessive-precision` implied by `-D warnings`
8
8
@@ -28,7 +28,7 @@ error: float has excessive precision
28
28
--> $DIR/excessive_precision.rs:20:26
29
29
|
30
30
LL | const BAD64_1: f64 = 0.123_456_789_012_345_67f64;
31
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66 `
31
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66_f64 `
32
32
33
33
error: float has excessive precision
34
34
--> $DIR/excessive_precision.rs:21:26
@@ -58,13 +58,13 @@ error: float has excessive precision
58
58
--> $DIR/excessive_precision.rs:37:26
59
59
|
60
60
LL | let bad32_suf: f32 = 1.123_456_789_f32;
61
- | ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8 `
61
+ | ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8_f32 `
62
62
63
63
error: float has excessive precision
64
64
--> $DIR/excessive_precision.rs:38:21
65
65
|
66
66
LL | let bad32_inf = 1.123_456_789_f32;
67
- | ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8 `
67
+ | ^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8_f32 `
68
68
69
69
error: float has excessive precision
70
70
--> $DIR/excessive_precision.rs:40:22
@@ -76,7 +76,7 @@ error: float has excessive precision
76
76
--> $DIR/excessive_precision.rs:41:26
77
77
|
78
78
LL | let bad64_suf: f64 = 0.123_456_789_012_345_67f64;
79
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66 `
79
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `0.123_456_789_012_345_66_f64 `
80
80
81
81
error: float has excessive precision
82
82
--> $DIR/excessive_precision.rs:42:21
@@ -108,5 +108,71 @@ error: float has excessive precision
108
108
LL | let bad_bige32: f32 = 1.123_456_788_888E-10;
109
109
| ^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8E-10`
110
110
111
- error: aborting due to 18 previous errors
111
+ error: literal cannot be represented as the underlying type without loss of precision
112
+ --> $DIR/excessive_precision.rs:65:18
113
+ |
114
+ LL | let _: f32 = 16_777_217.0;
115
+ | ^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_216.0`
116
+
117
+ error: literal cannot be represented as the underlying type without loss of precision
118
+ --> $DIR/excessive_precision.rs:66:18
119
+ |
120
+ LL | let _: f32 = 16_777_219.0;
121
+ | ^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
122
+
123
+ error: literal cannot be represented as the underlying type without loss of precision
124
+ --> $DIR/excessive_precision.rs:67:18
125
+ |
126
+ LL | let _: f32 = 16_777_219.;
127
+ | ^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
128
+
129
+ error: literal cannot be represented as the underlying type without loss of precision
130
+ --> $DIR/excessive_precision.rs:68:18
131
+ |
132
+ LL | let _: f32 = 16_777_219.000;
133
+ | ^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
134
+
135
+ error: literal cannot be represented as the underlying type without loss of precision
136
+ --> $DIR/excessive_precision.rs:69:13
137
+ |
138
+ LL | let _ = 16_777_219f32;
139
+ | ^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0_f32`
140
+
141
+ error: literal cannot be represented as the underlying type without loss of precision
142
+ --> $DIR/excessive_precision.rs:70:19
143
+ |
144
+ LL | let _: f32 = -16_777_219.0;
145
+ | ^^^^^^^^^^^^ help: consider changing the type or replacing it with: `16_777_220.0`
146
+
147
+ error: literal cannot be represented as the underlying type without loss of precision
148
+ --> $DIR/excessive_precision.rs:71:18
149
+ |
150
+ LL | let _: f64 = 9_007_199_254_740_993.0;
151
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
152
+
153
+ error: literal cannot be represented as the underlying type without loss of precision
154
+ --> $DIR/excessive_precision.rs:72:18
155
+ |
156
+ LL | let _: f64 = 9_007_199_254_740_993.;
157
+ | ^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
158
+
159
+ error: literal cannot be represented as the underlying type without loss of precision
160
+ --> $DIR/excessive_precision.rs:73:18
161
+ |
162
+ LL | let _: f64 = 9_007_199_254_740_993.000;
163
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
164
+
165
+ error: literal cannot be represented as the underlying type without loss of precision
166
+ --> $DIR/excessive_precision.rs:74:13
167
+ |
168
+ LL | let _ = 9_007_199_254_740_993f64;
169
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0_f64`
170
+
171
+ error: literal cannot be represented as the underlying type without loss of precision
172
+ --> $DIR/excessive_precision.rs:75:19
173
+ |
174
+ LL | let _: f64 = -9_007_199_254_740_993.0;
175
+ | ^^^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or replacing it with: `9_007_199_254_740_992.0`
176
+
177
+ error: aborting due to 29 previous errors
112
178
0 commit comments