@@ -2,7 +2,7 @@ error: float has excessive precision
22 --> $DIR/excessive_precision.rs:15:26
33 |
44LL | 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 `
66 |
77 = note: `-D clippy::excessive-precision` implied by `-D warnings`
88
@@ -28,7 +28,7 @@ error: float has excessive precision
2828 --> $DIR/excessive_precision.rs:20:26
2929 |
3030LL | 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 `
3232
3333error: float has excessive precision
3434 --> $DIR/excessive_precision.rs:21:26
@@ -58,13 +58,13 @@ error: float has excessive precision
5858 --> $DIR/excessive_precision.rs:37:26
5959 |
6060LL | 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 `
6262
6363error: float has excessive precision
6464 --> $DIR/excessive_precision.rs:38:21
6565 |
6666LL | 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 `
6868
6969error: float has excessive precision
7070 --> $DIR/excessive_precision.rs:40:22
@@ -76,7 +76,7 @@ error: float has excessive precision
7676 --> $DIR/excessive_precision.rs:41:26
7777 |
7878LL | 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 `
8080
8181error: float has excessive precision
8282 --> $DIR/excessive_precision.rs:42:21
@@ -108,5 +108,71 @@ error: float has excessive precision
108108LL | let bad_bige32: f32 = 1.123_456_788_888E-10;
109109 | ^^^^^^^^^^^^^^^^^^^^^ help: consider changing the type or truncating it to: `1.123_456_8E-10`
110110
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
112178
0 commit comments